brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.1 KiB · f7d1ed4 Raw
29 lines · plain
1; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=instructions --test FileCheck --test-arg --check-prefixes=CHECK,INTERESTING --test-arg %s --test-arg --input-file %s -o %t2; RUN: FileCheck -check-prefixes=CHECK,RESULT %s < %t3 4; Make sure verifier errors aren't produced from trying to delete5; swifterror instructions.6 7%swift_error = type { i64, i8 }8 9declare float @foo(ptr swifterror %error_ptr_ref)10 11; CHECK-LABEL: define float @caller(12; INTERESTING: call float @foo(13 14; RESULT: %error_ptr_ref = alloca swifterror ptr, align 815; RESULT-NEXT: %call = call float @foo(ptr swifterror %error_ptr_ref)16; RESULT-NEXT: ret float17define float @caller(ptr %error_ref) {18entry:19  %error_ptr_ref = alloca swifterror ptr20  store ptr null, ptr %error_ptr_ref21  %call = call float @foo(ptr swifterror %error_ptr_ref)22  %error_from_foo = load ptr, ptr %error_ptr_ref23  %had_error_from_foo = icmp ne ptr %error_from_foo, null24  %v1 = getelementptr inbounds %swift_error, ptr %error_from_foo, i64 0, i32 125  %t = load i8, ptr %v126  store i8 %t, ptr %error_ref27  ret float 1.028}29