]> granicus.if.org Git - clang/commitdiff
Enable test/CodeGen/indirect-goto.c in 64b for local arrays
authorGerolf Hoflehner <ghoflehner@apple.com>
Tue, 1 Jul 2014 05:10:06 +0000 (05:10 +0000)
committerGerolf Hoflehner <ghoflehner@apple.com>
Tue, 1 Jul 2014 05:10:06 +0000 (05:10 +0000)
In 32b mode the reference count for block addresses
is not zero. This prevents inlining and constant
folding and causes the test to fail. Changing
the triple allows runnning the test in 64b mode.

The array in foo2 is now local instead of static until
at lower optimization levels the interprocedural constant
propagator is invoked before the global optimizer.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@212092 91177308-0d34-0410-b5e6-96231b3b80d8

test/CodeGen/indirect-goto.c

index bea83ee264eec7892364ff30ba7e4c7aaf708971..22dbcad367b04a983420b3a4cdc296a9c7396294 100644 (file)
@@ -1,5 +1,4 @@
-// RUN: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm -o - %s
-// DISABLED: %clang_cc1 -triple i386-unknown-unknown -O3 -emit-llvm -o - %s | grep "ret i32 2520"
+// RUN: %clang_cc1 -triple x86_64-unknown-unknown -O3 -emit-llvm -o - %s | grep "ret i32 2520"
 
 static int foo(unsigned i) {
   void *addrs[] = { &&L1, &&L2, &&L3, &&L4, &&L5 };
@@ -15,7 +14,7 @@ static int foo(unsigned i) {
 }
 
 static int foo2(unsigned i) {
-  static const void *addrs[] = { &&L1, &&L2, &&L3, &&L4, &&L5 };
+  const void *addrs[] = { &&L1, &&L2, &&L3, &&L4, &&L5 };
   int res = 1;
   
   goto *addrs[i];