aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
committerBen Cheng <bccheng@google.com>2014-03-25 22:37:19 -0700
commit1bc5aee63eb72b341f506ad058502cd0361f0d10 (patch)
treec607e8252f3405424ff15bc2d00aa38dadbb2518 /gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c
parent283a0bf58fcf333c58a2a92c3ebbc41fb9eb1fdb (diff)
downloadtoolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.gz
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.tar.bz2
toolchain_gcc-1bc5aee63eb72b341f506ad058502cd0361f0d10.zip
Initial checkin of GCC 4.9.0 from trunk (r208799).
Change-Id: I48a3c08bb98542aa215912a75f03c0890e497dba
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c55
1 files changed, 55 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c b/gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c
new file mode 100644
index 000000000..1c5575bde
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.dg/20050321-2.c
@@ -0,0 +1,55 @@
+/* This testcase could not assemble on ppc32, because the compiler assumed
+ the huge ADDR_DIFF_VEC will be emitted into rodata section, yet because
+ of some notes inserted between jump table's CODE_LABEL and the jump table
+ it ended up in the .text section and thus shorten_branches couldn't
+ figure out branch to lab is too far. */
+/* { dg-do link { target fpic } } */
+/* { dg-options "-g1 -fpic" } */
+/* { dg-require-effective-target int32plus } */
+
+#define A(n) \
+ case n##1: return n##1 * 131 + 63; \
+ case n##3: return n##3 * 1231 + 182; \
+ case n##5: return n##5 * 351 + 1; \
+ case n##7: return n##7 * 312 + 61; \
+ case n##9: return n##9 * 17 - 1;
+#define B(n) \
+A(n##0) A(n##1) A(n##2) A(n##3) A(n##4) \
+A(n##5) A(n##6) A(n##7) A(n##8) A(n##9)
+#define C(n) \
+B(n##0) B(n##1) B(n##2) B(n##3) B(n##4) \
+B(n##5) B(n##6) B(n##7) B(n##8) B(n##9)
+#define D(n) \
+C(n##0) C(n##1) B(n##20) B(n##21) B(n##22)
+
+int
+foo (int x)
+{
+ {
+lab:;
+ int a = x;
+ while (a < 60000)
+ {
+ int b = a;
+ {
+ int c = b;
+ switch (c)
+ {
+ D(1)
+ default: break;
+ }
+ }
+ a += 10000;
+ if (a == 4168)
+ goto lab;
+ }
+ }
+ return x;
+}
+
+int
+main (void)
+{
+ foo (71);
+ return 0;
+}