diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-01 11:31:48 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2012-10-01 11:31:48 +0000 |
commit | 64f27e78c4af3b69930b1d05b13b80cb025f4079 (patch) | |
tree | 9990ceed68da5c49c5024ea8608f12bb0bc06438 /test/Transforms/SimplifyCFG | |
parent | 1e1b16c48515d6d54525ab279e4acb5ddd05c83d (diff) | |
download | external_llvm-64f27e78c4af3b69930b1d05b13b80cb025f4079.zip external_llvm-64f27e78c4af3b69930b1d05b13b80cb025f4079.tar.gz external_llvm-64f27e78c4af3b69930b1d05b13b80cb025f4079.tar.bz2 |
SimplifyCFG: Don't crash when forming a switch bitmap with an undef default value.
Fixes PR13985.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164934 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/SimplifyCFG')
-rw-r--r-- | test/Transforms/SimplifyCFG/switch_to_lookup_table.ll | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/Transforms/SimplifyCFG/switch_to_lookup_table.ll b/test/Transforms/SimplifyCFG/switch_to_lookup_table.ll index 134ac4e..aa48ec6 100644 --- a/test/Transforms/SimplifyCFG/switch_to_lookup_table.ll +++ b/test/Transforms/SimplifyCFG/switch_to_lookup_table.ll @@ -269,3 +269,27 @@ if.end: ; CHECK: switch ; CHECK: phi } + +; PR13985 +define i1 @undef(i32 %tmp) uwtable ssp { +bb: + switch i32 %tmp, label %bb3 [ + i32 0, label %bb1 + i32 1, label %bb1 + i32 7, label %bb2 + i32 8, label %bb2 + ] + +bb1: ; preds = %bb, %bb + br label %bb3 + +bb2: ; preds = %bb, %bb + br label %bb3 + +bb3: ; preds = %bb2, %bb1, %bb + %tmp4 = phi i1 [ undef, %bb ], [ false, %bb2 ], [ true, %bb1 ] + ret i1 %tmp4 +; CHECK: define i1 @undef +; CHECK: %switch.cast = trunc i32 %switch.tableidx to i9 +; CHECK: %switch.downshift = lshr i9 3, %switch.shiftamt +} |