annotate gcc/testsuite/gcc.dg/c11-align-5.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test C11 alignment support. Test invalid code. */
kono
parents:
diff changeset
2 /* { dg-do compile } */
kono
parents:
diff changeset
3 /* { dg-options "-std=c11 -pedantic-errors" } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 void foo (int []);
kono
parents:
diff changeset
6 void bar1 (int [_Alignas (double) 10]); /* { dg-error "expected expression before" } */
kono
parents:
diff changeset
7 void bar2 (int [static _Alignas (double) 10]); /* { dg-error "expected expression before" } */
kono
parents:
diff changeset
8 void bar3 (int [static const _Alignas (double) 10]); /* { dg-error "expected expression before" } */
kono
parents:
diff changeset
9 void bar4 (int [const _Alignas (double) 10]); /* { dg-error "expected expression before" } */
kono
parents:
diff changeset
10 void bar5 (int [_Alignas (0) *]); /* { dg-error "expected expression before" } */
kono
parents:
diff changeset
11
kono
parents:
diff changeset
12 void foo (int a[_Alignas (0) 10]) { } /* { dg-error "expected expression before" } */
kono
parents:
diff changeset
13
kono
parents:
diff changeset
14 void
kono
parents:
diff changeset
15 test (void)
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 int *_Alignas (long) p; /* { dg-error "expected" } */
kono
parents:
diff changeset
18 int *const _Alignas (long) *q; /* { dg-error "expected" } */
kono
parents:
diff changeset
19 struct s { int n; };
kono
parents:
diff changeset
20 __builtin_offsetof (struct s _Alignas (int), n); /* { dg-error "expected" } */
kono
parents:
diff changeset
21 __typeof (long double _Alignas (0)) e; /* { dg-error "expected" } */
131
84e7813d76e9 gcc-8.2
mir3636
parents: 111
diff changeset
22 sizeof (int _Alignas (int)); /* { dg-error "specified for type name" } */
111
kono
parents:
diff changeset
23 _Alignas (int _Alignas (float)) int t; /* { dg-error "expected" } */
kono
parents:
diff changeset
24 __builtin_types_compatible_p (signed _Alignas (0), unsigned); /* { dg-error "expected" } */
kono
parents:
diff changeset
25 int a[_Alignas (int) 10]; /* { dg-error "expected expression before" } */
kono
parents:
diff changeset
26 int b[10];
kono
parents:
diff changeset
27 foo (b);
kono
parents:
diff changeset
28 }