40 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py2; RUN: opt < %s -S -passes=ipsccp | FileCheck %s3; PR55964 5; IPSCCP should propagate the 0 argument, eliminate the switch, and propagate6; the result.7 8define i32 @main() noreturn nounwind {9; CHECK-LABEL: @main(10; CHECK-NEXT: entry:11; CHECK-NEXT: ret i32 12312;13entry:14 %call2 = tail call i32 @wwrite(i64 0) nounwind15 ret i32 %call216}17 18define internal i32 @wwrite(i64 %i) nounwind readnone willreturn {19; CHECK-LABEL: @wwrite(20; CHECK-NEXT: entry:21; CHECK-NEXT: br label [[SW_DEFAULT:%.*]]22; CHECK: sw.default:23; CHECK-NEXT: ret i32 poison24;25entry:26 switch i64 %i, label %sw.default [27 i64 3, label %return28 i64 10, label %return29 ]30 31sw.default:32 ret i32 12333 34return:35 ret i32 036}37 38; CHECK: attributes #0 = { noreturn nounwind }39; CHECK: attributes #1 = { nounwind willreturn memory(none) }40