PR inline-asm/84742
[official-gcc.git] / gcc / testsuite / objc.dg / encode-11.m
blob2e5fc84c86329eb9dd6acfa1db13661faedfbce2
1 /* { dg-do run } */
3 extern void _exit(int);
4 extern int strcmp(const char *, const char *);
6 typedef struct Vec {
7  double xv[10], yv[5];
8  float fscal;
9  int z;
10 } xyz_t ;
12 typedef struct {
13   float fscalar;
14   double dscalar;
15   xyz_t dv;
16   int iscalar;
17   long ln;
18   long long lln;
19 } anonymous;
21 const char *enc = @encode(xyz_t);
22 const char *enc2 = @encode(anonymous);
24 #ifdef __LP64__
25 #define L "q"
26 #else
27 #define L "l"
28 #endif
30 int main(void) {
31   const char *encode = @encode(long);
33   if (strcmp (encode, L))
34     _exit(-(__LINE__));
36   if (strcmp (enc, "{Vec=[10d][5d]fi}"))
37     _exit(-(__LINE__));
39   if (strcmp (enc2, "{?=fd{Vec=[10d][5d]fi}i" L "q}"))
40     _exit(-(__LINE__));
42   return 0;