diff options
Diffstat (limited to 'llvm/test/tools')
-rw-r--r-- | llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips64_eh.ll.expected | 6 | ||||
-rw-r--r-- | llvm/test/tools/dxil-dis/lifetimes.ll | 38 |
2 files changed, 41 insertions, 3 deletions
diff --git a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips64_eh.ll.expected b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips64_eh.ll.expected index 897209a..56058bb 100644 --- a/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips64_eh.ll.expected +++ b/llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/mips64_eh.ll.expected @@ -8,17 +8,17 @@ define i32 @main() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to ; CHECK-NEXT: .cfi_def_cfa_offset 16 ; CHECK-NEXT: sd $ra, 8($sp) # 8-byte Folded Spill ; CHECK-NEXT: .cfi_offset 31, -8 -; CHECK-NEXT: .Ltmp0: +; CHECK-NEXT: .Ltmp0: # EH_LABEL ; CHECK-NEXT: jal foo ; CHECK-NEXT: nop -; CHECK-NEXT: .Ltmp1: +; CHECK-NEXT: .Ltmp1: # EH_LABEL ; CHECK-NEXT: # %bb.1: # %good ; CHECK-NEXT: addiu $2, $zero, 5 ; CHECK-NEXT: ld $ra, 8($sp) # 8-byte Folded Reload ; CHECK-NEXT: jr $ra ; CHECK-NEXT: daddiu $sp, $sp, 16 ; CHECK-NEXT: .LBB0_2: # %bad -; CHECK-NEXT: .Ltmp2: +; CHECK-NEXT: .Ltmp2: # EH_LABEL ; CHECK-NEXT: jal _Unwind_Resume ; CHECK-NEXT: nop %1 = invoke i32 @foo() to label %good unwind label %bad diff --git a/llvm/test/tools/dxil-dis/lifetimes.ll b/llvm/test/tools/dxil-dis/lifetimes.ll new file mode 100644 index 0000000..cb3e629 --- /dev/null +++ b/llvm/test/tools/dxil-dis/lifetimes.ll @@ -0,0 +1,38 @@ +; RUN: llc --filetype=obj %s -o - | dxil-dis -o - | FileCheck %s +target triple = "dxil-unknown-shadermodel6.7-library" + +define void @test_lifetimes() { +; CHECK-LABEL: test_lifetimes +; CHECK-NEXT: [[ALLOCA:%.*]] = alloca [2 x i32], align 4 +; CHECK-NEXT: [[GEP:%.*]] = getelementptr [2 x i32], [2 x i32]* [[ALLOCA]], i32 0, i32 0 +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast [2 x i32]* [[ALLOCA]] to i8* +; CHECK-NEXT: call void @llvm.lifetime.start(i64 4, i8* nonnull [[BITCAST]]) +; CHECK-NEXT: store i32 0, i32* [[GEP]], align 4 +; CHECK-NEXT: [[BITCAST:%.*]] = bitcast [2 x i32]* [[ALLOCA]] to i8* +; CHECK-NEXT: call void @llvm.lifetime.end(i64 4, i8* nonnull [[BITCAST]]) +; CHECK-NEXT: ret void +; + %a = alloca [2 x i32], align 4 + %gep = getelementptr [2 x i32], ptr %a, i32 0, i32 0 + call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %a) + store i32 0, ptr %gep, align 4 + call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %a) + ret void +} + +; CHECK-DAG: attributes [[LIFETIME_ATTRS:#.*]] = { nounwind } + +; CHECK-DAG: ; Function Attrs: nounwind +; CHECK-DAG: declare void @llvm.lifetime.start(i64, i8* nocapture) [[LIFETIME_ATTRS]] + +; CHECK-DAG: ; Function Attrs: nounwind +; CHECK-DAG: declare void @llvm.lifetime.end(i64, i8* nocapture) [[LIFETIME_ATTRS]] + +; Function Attrs: nounwind memory(argmem: readwrite) +declare void @llvm.lifetime.end.p0(i64, ptr) #0 + +; Function Attrs: nounwind memory(argmem: readwrite) +declare void @llvm.lifetime.start.p0(i64, ptr) #0 + +attributes #0 = { nounwind memory(argmem: readwrite) } + |