diff options
Diffstat (limited to 'test/CodeGen/Generic')
-rw-r--r-- | test/CodeGen/Generic/MachineBranchProb.ll | 2 | ||||
-rw-r--r-- | test/CodeGen/Generic/dbg_value.ll | 4 | ||||
-rw-r--r-- | test/CodeGen/Generic/empty-phi.ll | 19 | ||||
-rw-r--r-- | test/CodeGen/Generic/overloaded-intrinsic-name.ll | 57 | ||||
-rw-r--r-- | test/CodeGen/Generic/print-machineinstrs.ll | 2 |
5 files changed, 80 insertions, 4 deletions
diff --git a/test/CodeGen/Generic/MachineBranchProb.ll b/test/CodeGen/Generic/MachineBranchProb.ll index 0e98280..83277c9 100644 --- a/test/CodeGen/Generic/MachineBranchProb.ll +++ b/test/CodeGen/Generic/MachineBranchProb.ll @@ -32,4 +32,4 @@ return: ret i32 %retval.0 } -!0 = metadata !{metadata !"branch_weights", i32 7, i32 6, i32 4, i32 4, i32 64} +!0 = !{!"branch_weights", i32 7, i32 6, i32 4, i32 4, i32 64} diff --git a/test/CodeGen/Generic/dbg_value.ll b/test/CodeGen/Generic/dbg_value.ll index 73e41c7..ed7bdba 100644 --- a/test/CodeGen/Generic/dbg_value.ll +++ b/test/CodeGen/Generic/dbg_value.ll @@ -4,11 +4,11 @@ %0 = type { i32, i32 } define void @t(%0*, i32, i32, i32, i32) nounwind { - tail call void @llvm.dbg.value(metadata !{%0* %0}, i64 0, metadata !0, metadata !{metadata !"0x102"}) + tail call void @llvm.dbg.value(metadata %0* %0, i64 0, metadata !0, metadata !{!"0x102"}) unreachable } declare void @llvm.dbg.value(metadata, i64, metadata, metadata) nounwind readnone ; !0 should conform to the format of DIVariable. -!0 = metadata !{metadata !"0x101\00a\000\000", null, null, null} ; [ DW_TAG_arg_variable ] +!0 = !{!"0x101\00a\000\000", null, null, null} ; [ DW_TAG_arg_variable ] diff --git a/test/CodeGen/Generic/empty-phi.ll b/test/CodeGen/Generic/empty-phi.ll new file mode 100644 index 0000000..8d5f3b9 --- /dev/null +++ b/test/CodeGen/Generic/empty-phi.ll @@ -0,0 +1,19 @@ +; RUN: llc < %s + +define void @f() { +entry: + br label %bb1 + +bb1: + %0 = phi [0 x { i8*, i64, i64 }] [ %load, %bb2 ], [ undef, %entry ] + store [0 x { i8*, i64, i64 }] %0, [0 x { i8*, i64, i64 }]* undef, align 8 + %1 = icmp eq i64 undef, 0 + br i1 %1, label %bb2, label %bb3 + +bb2: + %load = load [0 x { i8*, i64, i64 }]* undef, align 8 + br label %bb1 + +bb3: + ret void +} diff --git a/test/CodeGen/Generic/overloaded-intrinsic-name.ll b/test/CodeGen/Generic/overloaded-intrinsic-name.ll new file mode 100644 index 0000000..aa6a031 --- /dev/null +++ b/test/CodeGen/Generic/overloaded-intrinsic-name.ll @@ -0,0 +1,57 @@ +; RUN: opt -verify -S < %s + +; Tests the name mangling performed by the codepath following +; getMangledTypeStr(). Only tests that code with the various manglings +; run fine: doesn't actually test the mangling with the type of the +; arguments. Meant to serve as an example-document on how the user +; should do name manglings. + +; Exercise the most general case, llvm_anyptr_type, using gc.relocate +; and gc.statepoint. Note that it has nothing to do with gc.* +; functions specifically: any function that accepts llvm_anyptr_type +; will serve the purpose. + +; function and integer +define i32* @test_iAny(i32* %v) { + %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, i32* %v) + %v-new = call i32* @llvm.experimental.gc.relocate.p0i32(i32 %tok, i32 4, i32 4) + ret i32* %v-new +} + +; float +define float* @test_fAny(float* %v) { + %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, float* %v) + %v-new = call float* @llvm.experimental.gc.relocate.p0f32(i32 %tok, i32 4, i32 4) + ret float* %v-new +} + +; array of integers +define [3 x i32]* @test_aAny([3 x i32]* %v) { + %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, [3 x i32]* %v) + %v-new = call [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(i32 %tok, i32 4, i32 4) + ret [3 x i32]* %v-new +} + +; vector of integers +define <3 x i32>* @test_vAny(<3 x i32>* %v) { + %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, <3 x i32>* %v) + %v-new = call <3 x i32>* @llvm.experimental.gc.relocate.p0v3i32(i32 %tok, i32 4, i32 4) + ret <3 x i32>* %v-new +} + +%struct.test = type { i32, i1 } + +; struct +define %struct.test* @test_struct(%struct.test* %v) { + %tok = call i32 (i1 ()*, i32, i32, ...)* @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()* @return_i1, i32 0, i32 0, i32 0, %struct.test* %v) + %v-new = call %struct.test* @llvm.experimental.gc.relocate.p0struct.test(i32 %tok, i32 4, i32 4) + ret %struct.test* %v-new +} + +declare zeroext i1 @return_i1() +declare i32 @llvm.experimental.gc.statepoint.p0f_i1f(i1 ()*, i32, i32, ...) +declare i32* @llvm.experimental.gc.relocate.p0i32(i32, i32, i32) +declare float* @llvm.experimental.gc.relocate.p0f32(i32, i32, i32) +declare [3 x i32]* @llvm.experimental.gc.relocate.p0a3i32(i32, i32, i32) +declare <3 x i32>* @llvm.experimental.gc.relocate.p0v3i32(i32, i32, i32) +declare %struct.test* @llvm.experimental.gc.relocate.p0struct.test(i32, i32, i32) diff --git a/test/CodeGen/Generic/print-machineinstrs.ll b/test/CodeGen/Generic/print-machineinstrs.ll index 75dceb5..26bccaa 100644 --- a/test/CodeGen/Generic/print-machineinstrs.ll +++ b/test/CodeGen/Generic/print-machineinstrs.ll @@ -3,7 +3,7 @@ ; RUN: llc < %s -O3 -debug-pass=Structure -print-machineinstrs= -o /dev/null 2>&1 | FileCheck %s define i64 @foo(i64 %a, i64 %b) nounwind { -; CHECK: -branch-folder -print-machineinstrs +; CHECK: -branch-folder -machineinstr-printer ; CHECK: Control Flow Optimizer ; CHECK-NEXT: MachineFunction Printer ; CHECK: Machine code for function foo: |