Debian Codegraph @

gcc/testsuite/c-c++-common/cpp/embed-23.c

raw
1 /* { dg-do run } */
2 /* { dg-options "-O2" } */
3 /* { dg-additional-options "-std=gnu23" { target c } } */
4
5 typedef unsigned char V __attribute__((vector_size (16)));
6
7 struct S { _Complex double a; V b; int c; };
8 struct T { int a; struct S b; int c; struct S d; int e; unsigned char f[22]; _Complex long double g; };
9
10 const unsigned char a[] = {
11 #embed __FILE__ limit (124)
12 };
13 const struct T b[2] = {
14 #embed __FILE__ limit (124)
15 };
16
17 int
18 main ()
19 {
20 for (int i = 0; i < 2; ++i)
21 if (b[i].a != a[i * 62]
22 || __real__ b[i].b.a != a[i * 62 + 1]
23 || __imag__ b[i].b.a
24 || __builtin_memcmp (&b[i].b.b, &a[i * 62 + 2], 16)
25 || b[i].b.c != a[i * 62 + 18]
26 || b[i].c != a[i * 62 + 19]
27 || __real__ b[i].d.a != a[i * 62 + 20]
28 || __imag__ b[i].d.a
29 || __builtin_memcmp (&b[i].d.b, &a[i * 62 + 21], 16)
30 || b[i].d.c != a[i * 62 + 37]
31 || b[i].e != a[i * 62 + 38]
32 || __builtin_memcmp (&b[i].f[0], &a[i * 62 + 39], 22)
33 || __real__ b[i].g != a[i * 62 + 61]
34 || __imag__ b[i].g)
35 __builtin_abort ();
36 }