summaryrefslogtreecommitdiff
path: root/gcc/testsuite/obj-c++.dg/encode-2.mm
blob: 157bb526700b8c610b183756d6a0713c71cc8a94 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/* { dg-do assemble } */
/* { dg-options "-save-temps" } */

template <class T>
struct Vec {
 T x, y;
 int z;
};

typedef struct {
  Vec<double> dvec;
  Vec<float> fvec;
  float fscalar;
  double dscalar;
  Vec<signed char> chVec;
  int iscalar;
} anonymous;

Vec<double> dd;

const char *enc = @encode(Vec<float>);
const char *enc2 = @encode(Vec<double>);
const char *enc3 = @encode(anonymous);

/* { dg-final { scan-assembler "{Vec<float>=ffi}" } }  */
/* { dg-final { scan-assembler "{Vec<double>=ddi}" } }  */
/* { dg-final { scan-file "encode-2.o" "{?={Vec<double>=ddi}{Vec<float>=ffi}fd{Vec<signed char>=cci}i}" } }
/* { dg-final cleanup-saved-temps } */