aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/ipa/pr84658.C
diff options
context:
space:
mode:
authoravieira <avieira@138bc75d-0d04-0410-961f-82ee72b054a4>2018-06-22 14:59:21 +0000
committeravieira <avieira@138bc75d-0d04-0410-961f-82ee72b054a4>2018-06-22 14:59:21 +0000
commit6a298aa6205bdcd75ed64e7a6fed9dd03c65db17 (patch)
treed887d893f39d16e4990a853d3398dfc48433430f /gcc/testsuite/g++.dg/ipa/pr84658.C
parent08de971a04b3432ec9323b1cafdd9ff5a28e0efb (diff)
parent33c4d56ec8b65b998b1a6751e19e3005f1bc401e (diff)
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/ARM/embedded-7-branch@261903 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/g++.dg/ipa/pr84658.C')
-rw-r--r--gcc/testsuite/g++.dg/ipa/pr84658.C30
1 files changed, 30 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/ipa/pr84658.C b/gcc/testsuite/g++.dg/ipa/pr84658.C
new file mode 100644
index 00000000000..6846e1832bd
--- /dev/null
+++ b/gcc/testsuite/g++.dg/ipa/pr84658.C
@@ -0,0 +1,30 @@
+/* PR ipa/84658 */
+/* { dg-do run } */
+/* { dg-options "-O2 -fmerge-all-constants -std=c++11" } */
+
+const int kTestCasesFoo[] = { 0, 1, 2, 3, 4, 5, 8, 15, 16, 17, 512, 1020, 1021, 1022, 1023, 1024 };
+const int kTestCasesBar[] = { 0, 1, 2, 3, 4, 5, 8, 15, 16, 17, 512, 1020, 1021, 1022, 1023, 1024 };
+
+void Foo() {
+ __builtin_printf("foo:");
+ for (int count : kTestCasesFoo) {
+ __builtin_printf("%d,", count);
+ }
+ __builtin_printf(";\n");
+}
+
+void Bar() {
+ __builtin_printf("bar:");
+ for (int count : kTestCasesBar) {
+ __builtin_printf("%d,", count);
+ }
+ __builtin_printf(";\n");
+}
+
+int main() {
+ Foo();
+ Bar();
+}
+
+/* { dg-output "foo:0,1,2,3,4,5,8,15,16,17,512,1020,1021,1022,1023,1024,;(\n|\n\r|\r)*" } */
+/* { dg-output "bar:0,1,2,3,4,5,8,15,16,17,512,1020,1021,1022,1023,1024,;(\n|\n\r|\r)*" } */