summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2012-11-07 21:35:12 +0000
committerHans Wennborg <hans@hanshq.net>2012-11-07 21:35:12 +0000
commitb0319962cfdb18da38ef47da621f148fe144b092 (patch)
tree7ef69b3a6830545f7264a821fbdec697060668b2 /test
parente90a3bcae1cd936aa760cffe5607266279b210d1 (diff)
downloadllvm-b0319962cfdb18da38ef47da621f148fe144b092.tar.gz
llvm-b0319962cfdb18da38ef47da621f148fe144b092.tar.bz2
llvm-b0319962cfdb18da38ef47da621f148fe144b092.tar.xz
Only do switch-to-lookup table transformation when TargetTransformInfo
is available. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167552 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Transforms/SimplifyCFG/X86/lit.local.cfg6
-rw-r--r--test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll (renamed from test/Transforms/SimplifyCFG/switch_to_lookup_table.ll)2
-rw-r--r--test/Transforms/SimplifyCFG/switch_create.ll5
3 files changed, 9 insertions, 4 deletions
diff --git a/test/Transforms/SimplifyCFG/X86/lit.local.cfg b/test/Transforms/SimplifyCFG/X86/lit.local.cfg
new file mode 100644
index 0000000000..a8ad0f1a28
--- /dev/null
+++ b/test/Transforms/SimplifyCFG/X86/lit.local.cfg
@@ -0,0 +1,6 @@
+config.suffixes = ['.ll', '.c', '.cpp']
+
+targets = set(config.root.targets_to_build.split())
+if not 'X86' in targets:
+ config.unsupported = True
+
diff --git a/test/Transforms/SimplifyCFG/switch_to_lookup_table.ll b/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
index 0f5eb6a135..8a59992f5e 100644
--- a/test/Transforms/SimplifyCFG/switch_to_lookup_table.ll
+++ b/test/Transforms/SimplifyCFG/X86/switch_to_lookup_table.ll
@@ -1,4 +1,4 @@
-; RUN: opt < %s -simplifycfg -S | FileCheck %s
+; RUN: opt < %s -simplifycfg -S -mtriple=x86_64-unknown-linux-gnu | FileCheck %s
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
diff --git a/test/Transforms/SimplifyCFG/switch_create.ll b/test/Transforms/SimplifyCFG/switch_create.ll
index b28e4a4550..546cc75f29 100644
--- a/test/Transforms/SimplifyCFG/switch_create.ll
+++ b/test/Transforms/SimplifyCFG/switch_create.ll
@@ -141,9 +141,8 @@ UnifiedReturnBlock: ; preds = %shortcirc_done.4, %shortcirc_next.4
ret i1 %UnifiedRetVal
; CHECK: @test6
-; CHECK: %switch.tableidx = sub i32 %tmp.2.i, 14
-; CHECK: %0 = icmp ult i32 %switch.tableidx, 6
-; CHECK: select i1 %0, i1 true, i1 false
+; CHECK: %tmp.2.i.off = add i32 %tmp.2.i, -14
+; CHECK: %switch = icmp ult i32 %tmp.2.i.off, 6
}
define void @test7(i8 zeroext %c, i32 %x) nounwind ssp noredzone {