Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.c-torture/execute/pr44575.c @ 111:04ced10e8804
gcc 7
author | kono |
---|---|
date | Fri, 27 Oct 2017 22:46:09 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
68:561a7518be6b | 111:04ced10e8804 |
---|---|
1 /* PR target/44575 */ | |
2 | |
3 #include <stdarg.h> | |
4 | |
5 int fails = 0; | |
6 struct S { float a[3]; }; | |
7 struct S a[5]; | |
8 | |
9 void | |
10 check (int z, ...) | |
11 { | |
12 struct S arg, *p; | |
13 va_list ap; | |
14 int j = 0, k = 0; | |
15 int i; | |
16 va_start (ap, z); | |
17 for (i = 2; i < 4; ++i) | |
18 { | |
19 p = 0; | |
20 j++; | |
21 k += 2; | |
22 switch ((z << 4) | i) | |
23 { | |
24 case 0x12: | |
25 case 0x13: | |
26 p = &a[2]; | |
27 arg = va_arg (ap, struct S); | |
28 break; | |
29 default: | |
30 ++fails; | |
31 break; | |
32 } | |
33 if (p && p->a[2] != arg.a[2]) | |
34 ++fails; | |
35 if (fails) | |
36 break; | |
37 } | |
38 va_end (ap); | |
39 } | |
40 | |
41 int | |
42 main () | |
43 { | |
44 a[2].a[2] = -49026; | |
45 check (1, a[2], a[2]); | |
46 if (fails) | |
47 abort (); | |
48 return 0; | |
49 } |