| 1 |
/* PR ipa/84658 */ |
| 2 |
/* { dg-do run } */ |
| 3 |
/* { dg-options "-O2 -fmerge-all-constants -std=c++11" } */ |
| 4 |
|
| 5 |
const int kTestCasesFoo[] = { 0, 1, 2, 3, 4, 5, 8, 15, 16, 17, 512, 1020, 1021, 1022, 1023, 1024 }; |
| 6 |
const int kTestCasesBar[] = { 0, 1, 2, 3, 4, 5, 8, 15, 16, 17, 512, 1020, 1021, 1022, 1023, 1024 }; |
| 7 |
|
| 8 |
void Foo() { |
| 9 |
__builtin_printf("foo:"); |
| 10 |
for (int count : kTestCasesFoo) { |
| 11 |
__builtin_printf("%d,", count); |
| 12 |
} |
| 13 |
__builtin_printf(";\n"); |
| 14 |
} |
| 15 |
|
| 16 |
void Bar() { |
| 17 |
__builtin_printf("bar:"); |
| 18 |
for (int count : kTestCasesBar) { |
| 19 |
__builtin_printf("%d,", count); |
| 20 |
} |
| 21 |
__builtin_printf(";\n"); |
| 22 |
} |
| 23 |
|
| 24 |
int main() { |
| 25 |
Foo(); |
| 26 |
Bar(); |
| 27 |
} |
| 28 |
|
| 29 |
/* { dg-output "foo:0,1,2,3,4,5,8,15,16,17,512,1020,1021,1022,1023,1024,;(\n|\n\r|\r)*" } */ |
| 30 |
/* { dg-output "bar:0,1,2,3,4,5,8,15,16,17,512,1020,1021,1022,1023,1024,;(\n|\n\r|\r)*" } */ |