Mercurial > hg > CbC > CbC_gcc
comparison gcc/testsuite/gcc.dg/pr48774.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/48774 */ | |
2 /* { dg-do run } */ | |
3 /* { dg-options "-O2 -funroll-loops" } */ | |
4 | |
5 extern void abort (void); | |
6 unsigned long int s[24] | |
7 = { 12, ~1, 12, ~2, 12, ~4, 12, ~8, 12, ~16, 12, ~32, | |
8 12, ~64, 12, ~128, 12, ~256, 12, ~512, 12, ~1024, 12, ~2048 }; | |
9 struct { int n; unsigned long *e[12]; } g | |
10 = { 12, { &s[0], &s[2], &s[4], &s[6], &s[8], &s[10], &s[12], &s[14], | |
11 &s[16], &s[18], &s[20], &s[22] } }; | |
12 int c[12]; | |
13 | |
14 __attribute__((noinline, noclone)) void | |
15 foo (void) | |
16 { | |
17 int i, j; | |
18 for (i = 0; i < g.n; i++) | |
19 for (j = 0; j < g.n; j++) | |
20 { | |
21 if (i == j && j < g.e[0][0] && (g.e[i][1] & (1UL << j))) | |
22 abort (); | |
23 if (j < g.e[0][0] && (g.e[i][1] & (1UL << j))) | |
24 c[i]++; | |
25 } | |
26 } | |
27 | |
28 int | |
29 main () | |
30 { | |
31 int i; | |
32 asm volatile ("" : "+m" (s), "+m" (g), "+m" (c)); | |
33 foo (); | |
34 for (i = 0; i < 12; i++) | |
35 if (c[i] != 11) | |
36 abort (); | |
37 return 0; | |
38 } |