annotate gcc/testsuite/gcc.dg/sso-9.c @ 145:1830386684a0

gcc-9.2.0
author anatofuz
date Thu, 13 Feb 2020 11:34:05 +0900
parents 04ced10e8804
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
111
kono
parents:
diff changeset
1 /* Test support of scalar_storage_order attribute */
kono
parents:
diff changeset
2
kono
parents:
diff changeset
3 /* { dg-do compile } */
kono
parents:
diff changeset
4
kono
parents:
diff changeset
5 #include <stdarg.h>
kono
parents:
diff changeset
6
kono
parents:
diff changeset
7 int x;
kono
parents:
diff changeset
8
kono
parents:
diff changeset
9 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
kono
parents:
diff changeset
10 struct __attribute__((scalar_storage_order("big-endian"))) Rec
kono
parents:
diff changeset
11 {
kono
parents:
diff changeset
12 va_list v;
kono
parents:
diff changeset
13 };
kono
parents:
diff changeset
14 #else
kono
parents:
diff changeset
15 struct __attribute__((scalar_storage_order("little-endian"))) Rec
kono
parents:
diff changeset
16 {
kono
parents:
diff changeset
17 va_list v;
kono
parents:
diff changeset
18 };
kono
parents:
diff changeset
19 #endif
kono
parents:
diff changeset
20
kono
parents:
diff changeset
21 void foo (int i, ...)
kono
parents:
diff changeset
22 {
kono
parents:
diff changeset
23 struct Rec a;
kono
parents:
diff changeset
24 va_start (a.v, i);
kono
parents:
diff changeset
25 a.v = 0, x = va_arg (a.v, int); /* { dg-error "type|reverse storage order" } */
kono
parents:
diff changeset
26 va_end (a.v);
kono
parents:
diff changeset
27 }