/* { dg-do run } */ extern "C" { extern void _exit(int); extern int strcmp(const char *, const char *); } template struct Vec { T x, y; long z; long long zz; }; typedef struct { float fscalar; double dv[10]; int iscalar; long z; long long zz; Vec cv; } anonymous; //Vec dd; const char *enc = @encode(Vec); const char *enc2 = @encode(Vec); const char *enc3 = @encode(anonymous); #ifdef __LP64__ #define L "q" #else #define L "l" #endif int main(void) { const char *encode = @encode(long); if (strcmp (encode, L)) _exit(-(__LINE__)); if (strcmp (enc, "{Vec=ff" L "q}")) _exit(-(__LINE__)); if (strcmp (enc2, "{Vec=dd" L "q}")) _exit(-(__LINE__)); if (strcmp (enc3, "{?=f[10d]i" L "q{Vec=rcrc" L "q}}")) _exit(-(__LINE__)); return 0; }