diff options
Diffstat (limited to 'llvm/test/Transforms/FunctionAttrs/liveness.ll')
| -rw-r--r-- | llvm/test/Transforms/FunctionAttrs/liveness.ll | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/llvm/test/Transforms/FunctionAttrs/liveness.ll b/llvm/test/Transforms/FunctionAttrs/liveness.ll index 85afb10ca08..2526d65bbf5 100644 --- a/llvm/test/Transforms/FunctionAttrs/liveness.ll +++ b/llvm/test/Transforms/FunctionAttrs/liveness.ll @@ -1,5 +1,6 @@ -; NOTE: Assertions have been autogenerated by utils/update_test_checks.py +; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --function-signature --scrub-attributes ; RUN: opt -attributor --attributor-disable=false -attributor-max-iterations-verify -attributor-annotate-decl-cs -attributor-max-iterations=6 -S < %s | FileCheck %s +; UTC_ARGS: --turn off declare void @no_return_call() nofree noreturn nounwind readnone @@ -748,3 +749,43 @@ define void @useless_arg_ext_int_ext(i32* %a) { call void @useless_arg_ext_int(i32* %a) ret void } + +; UTC_ARGS: --turn on + +; FIXME: We should fold terminators. + +define internal i32 @switch_default(i64 %i) nounwind { +; CHECK-LABEL: define {{[^@]+}}@switch_default +; CHECK-SAME: (i64 [[I:%.*]]) +; CHECK-NEXT: entry: +; CHECK-NEXT: switch i64 0, label [[SW_DEFAULT:%.*]] [ +; CHECK-NEXT: i64 3, label [[RETURN:%.*]] +; CHECK-NEXT: i64 10, label [[RETURN]] +; CHECK-NEXT: ] +; CHECK: sw.default: +; CHECK-NEXT: ret i32 123 +; CHECK: return: +; CHECK-NEXT: unreachable +; +entry: + switch i64 %i, label %sw.default [ + i64 3, label %return + i64 10, label %return + ] + +sw.default: + ret i32 123 + +return: + ret i32 0 +} + +define i32 @switch_default_caller() { +; CHECK-LABEL: define {{[^@]+}}@switch_default_caller() +; CHECK-NEXT: [[CALL2:%.*]] = tail call i32 @switch_default(i64 0) +; CHECK-NEXT: ret i32 123 +; + %call2 = tail call i32 @switch_default(i64 0) + ret i32 %call2 +} +; UTC_ARGS: --turn off |

