builtin-has-attribute-4.c: Skip on 32-bit hppa*-*-hpux*.
[official-gcc.git] / gcc / testsuite / gcc.dg / pr38245-3.c
blob6ef8372a14f2b7ed4c2b49550864f923303781eb
1 /* PR rtl-optimization/38245 */
2 /* { dg-do run } */
3 /* { dg-additional-sources "pr38245-4.c" } */
4 /* { dg-options "-O2" } */
6 #include "pr38245-3.h"
8 extern void abort (void);
10 struct A { int i, j; union { short s[4]; long long l; }; char pad[512]; } a;
11 int globv = 6;
13 void __attribute__((noinline))
14 f1 (void)
16 a.s[2] = b1 (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
17 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
18 a.l = 6;
21 void __attribute__((noinline))
22 f2 (void)
24 a.s[2] = b2 (6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21,
25 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21);
26 a.l = 6;
29 void __attribute__((noinline))
30 f3 (void)
32 struct B b = { 30, 31, { 32, 33 } };
33 a.s[2] = b3 (6, 7, 8, 9, 10, 11, 12, b, 14, b, 16, b, 18, 19, 20, 21,
34 6, b, 8, b, 10, 11, 12, 13, 14, b, 16, b, 18, 19, 20, 21);
35 a.l = 6;
38 void __attribute__((noinline))
39 f4 (void)
41 struct B b = { 30, 31, { 32, 33 } };
42 a.s[2] = b4 (6, 7, 8, 9, 10, 11, 12, b, 14, b, 16, b, 18, 19, 20, 21,
43 6, b, 8, b, 10, 11, 12, 13, 14, b, 16, b, 18, 19, 20, 21);
44 a.l = 6;
47 void __attribute__((noinline))
48 f5 (void)
50 a.s[2] = b5 (6.0, 7, 8, 9, 10, 11, 21.0, 22.0, 23.0);
51 a.l = 6;
54 void __attribute__((noinline))
55 f6 (void)
57 a.s[2] = b6 (6.0, 7, 8, 9, 10, 11, 21.0, 22.0, 23.0);
58 a.l = 6;
61 void __attribute__((noinline))
62 f7 (void)
64 a.s[2] = b7 (6, 7);
65 a.l = 6;
68 void __attribute__((noinline))
69 f8 (void)
71 a.s[2] = b8 (6, 7);
72 a.l = 6;
75 void __attribute__((noinline))
76 f9 (void)
78 a.s[2] = b9 (6, 7, 8, 9, 10, 11, 12);
79 a.l = 6;
82 void __attribute__((noinline))
83 f10 (void)
85 a.s[2] = b10 (6, 7, 8, 9, 10, 11, 12);
86 a.l = 6;
89 int
90 main (void)
92 char buf[256];
93 int i;
94 for (i = 0; i < (int) sizeof buf; i++)
95 buf[i] = i;
96 asm volatile ("" : : "r" (buf) : "memory");
97 f1 ();
98 f2 ();
99 f3 ();
100 f4 ();
101 f5 ();
102 f6 ();
103 f7 ();
104 f8 ();
105 f9 ();
106 f10 ();
107 asm volatile ("" : : "r" (buf) : "memory");
108 for (i = 0; i < (int) sizeof buf; i++)
109 if (buf[i] != (char) i)
110 abort ();
111 return 0;