diff options
Diffstat (limited to 'test/tools/gold')
-rw-r--r-- | test/tools/gold/mtriple.ll | 2 | ||||
-rw-r--r-- | test/tools/gold/opt-level.ll | 50 | ||||
-rw-r--r-- | test/tools/gold/option.ll | 39 | ||||
-rw-r--r-- | test/tools/gold/pr19901.ll | 3 | ||||
-rw-r--r-- | test/tools/gold/remarks.ll | 22 | ||||
-rw-r--r-- | test/tools/gold/slp-vectorize.ll | 14 | ||||
-rw-r--r-- | test/tools/gold/vectorize.ll | 6 |
7 files changed, 86 insertions, 50 deletions
diff --git a/test/tools/gold/mtriple.ll b/test/tools/gold/mtriple.ll index 94211ed..87b2260 100644 --- a/test/tools/gold/mtriple.ll +++ b/test/tools/gold/mtriple.ll @@ -1,3 +1,5 @@ +; REQUIRES: ld_emu_elf32ppc + ; RUN: llvm-as %s -o %t.o ; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -m elf32ppc \ ; RUN: -plugin-opt=mtriple=powerpc-linux-gnu \ diff --git a/test/tools/gold/opt-level.ll b/test/tools/gold/opt-level.ll new file mode 100644 index 0000000..3deb0af --- /dev/null +++ b/test/tools/gold/opt-level.ll @@ -0,0 +1,50 @@ +; RUN: llvm-as -o %t.bc %s +; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \ +; RUN: -plugin-opt=O0 -r -o %t.o %t.bc +; RUN: llvm-dis < %t.o.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s +; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \ +; RUN: -plugin-opt=O1 -r -o %t.o %t.bc +; RUN: llvm-dis < %t.o.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s +; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -plugin-opt=save-temps \ +; RUN: -plugin-opt=O2 -r -o %t.o %t.bc +; RUN: llvm-dis < %t.o.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s + +; CHECK-O0: define internal void @foo( +; CHECK-O1: define internal void @foo( +; CHECK-O2-NOT: define internal void @foo( +define internal void @foo() { + ret void +} + +; CHECK-O0: define internal i32 @bar( +; CHECK-O1: define internal i32 @bar( +define internal i32 @bar(i1 %p) { + br i1 %p, label %t, label %f + +t: + br label %end + +f: + br label %end + +end: + ; CHECK-O0: phi + ; CHECK-O1: select + %r = phi i32 [ 1, %t ], [ 2, %f ] + ret i32 %r +} + +define void @baz() { + call void @foo() + %c = call i32 @bar(i1 true) + ret void +} + +@a = constant i32 1 + +!0 = !{!"bitset1", i32* @a, i32 0} + +; CHECK-O0-NOT: llvm.bitsets +; CHECK-O1-NOT: llvm.bitsets +; CHECK-O2-NOT: llvm.bitsets +!llvm.bitsets = !{ !0 } diff --git a/test/tools/gold/option.ll b/test/tools/gold/option.ll deleted file mode 100644 index 59e3f1e..0000000 --- a/test/tools/gold/option.ll +++ /dev/null @@ -1,39 +0,0 @@ -; RUN: llvm-as %s -o %t.o -; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so -m elf_x86_64 \ -; RUN: --plugin-opt=-jump-table-type=arity \ -; RUN: --plugin-opt=-mattr=+aes \ -; RUN: --plugin-opt=mcpu=core-avx2 \ -; RUN: -shared %t.o -o %t2.o -; RUN: llvm-nm %t2.o | FileCheck %s - -; CHECK: t __llvm_jump_instr_table_0_1 -; CHECK: t __llvm_jump_instr_table_1_1 - -target triple = "x86_64-unknown-linux-gnu" -define i32 @g(i32 %a) unnamed_addr jumptable { - ret i32 %a -} - -define i32 (i32)* @get_g() { - ret i32 (i32)* @g -} - -define i32 @f() unnamed_addr jumptable { - ret i32 0 -} - -define i32 ()* @get_f() { - ret i32 ()* @f -} - -define <2 x i64> @test_aes(<2 x i64> %a0, <2 x i64> %a1) { - %res = call <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64> %a0, <2 x i64> %a1) - ret <2 x i64> %res -} -declare <2 x i64> @llvm.x86.aesni.aesenc(<2 x i64>, <2 x i64>) nounwind readnone - -define <32 x i8> @test_avx2(<16 x i16> %a0, <16 x i16> %a1) { - %res = call <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16> %a0, <16 x i16> %a1) - ret <32 x i8> %res -} -declare <32 x i8> @llvm.x86.avx2.packuswb(<16 x i16>, <16 x i16>) nounwind readnone diff --git a/test/tools/gold/pr19901.ll b/test/tools/gold/pr19901.ll index 2a7dea1..71bb134 100644 --- a/test/tools/gold/pr19901.ll +++ b/test/tools/gold/pr19901.ll @@ -1,6 +1,7 @@ ; RUN: llc %s -o %t.o -filetype=obj -relocation-model=pic ; RUN: llvm-as %p/Inputs/pr19901-1.ll -o %t2.o -; RUN: %gold -shared -o %t.so -plugin %llvmshlibdir/LLVMgold.so %t2.o %t.o +; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -shared -m elf_x86_64 -o %t.so %t2.o %t.o ; RUN: llvm-readobj -t %t.so | FileCheck %s ; CHECK: Symbol { diff --git a/test/tools/gold/remarks.ll b/test/tools/gold/remarks.ll new file mode 100644 index 0000000..c4fa7f7 --- /dev/null +++ b/test/tools/gold/remarks.ll @@ -0,0 +1,22 @@ +; RUN: llvm-as %s -o %t.o + +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: -plugin-opt=-pass-remarks=inline %t.o -o %t2.o 2>&1 | FileCheck %s + +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: %t.o -o %t2.o 2>&1 | FileCheck -allow-empty --check-prefix=NO-REMARK %s + + +; CHECK: f inlined into _start +; NO-REMARK-NOT: inlined +target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" +target triple = "x86_64-unknown-linux-gnu" + +define i32 @f() { + ret i32 0 +} + +define i32 @_start() { + %call = call i32 @f() + ret i32 %call +} diff --git a/test/tools/gold/slp-vectorize.ll b/test/tools/gold/slp-vectorize.ll index d39aa76..a75f0b3 100644 --- a/test/tools/gold/slp-vectorize.ll +++ b/test/tools/gold/slp-vectorize.ll @@ -11,19 +11,19 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" define void @f(float* nocapture %x) { - %tmp = load float* %x, align 4 + %tmp = load float, float* %x, align 4 %add = fadd float %tmp, 1.000000e+00 store float %add, float* %x, align 4 - %arrayidx1 = getelementptr inbounds float* %x, i64 1 - %tmp1 = load float* %arrayidx1, align 4 + %arrayidx1 = getelementptr inbounds float, float* %x, i64 1 + %tmp1 = load float, float* %arrayidx1, align 4 %add2 = fadd float %tmp1, 1.000000e+00 store float %add2, float* %arrayidx1, align 4 - %arrayidx3 = getelementptr inbounds float* %x, i64 2 - %tmp2 = load float* %arrayidx3, align 4 + %arrayidx3 = getelementptr inbounds float, float* %x, i64 2 + %tmp2 = load float, float* %arrayidx3, align 4 %add4 = fadd float %tmp2, 1.000000e+00 store float %add4, float* %arrayidx3, align 4 - %arrayidx5 = getelementptr inbounds float* %x, i64 3 - %tmp3 = load float* %arrayidx5, align 4 + %arrayidx5 = getelementptr inbounds float, float* %x, i64 3 + %tmp3 = load float, float* %arrayidx5, align 4 %add6 = fadd float %tmp3, 1.000000e+00 store float %add6, float* %arrayidx5, align 4 ret void diff --git a/test/tools/gold/vectorize.ll b/test/tools/gold/vectorize.ll index c1626d7..5f003dd 100644 --- a/test/tools/gold/vectorize.ll +++ b/test/tools/gold/vectorize.ll @@ -1,6 +1,6 @@ ; RUN: llvm-as %s -o %t.o -; RUN: %gold -plugin %llvmshlibdir/LLVMgold.so \ +; RUN: %gold -m elf_x86_64 -plugin %llvmshlibdir/LLVMgold.so \ ; RUN: --plugin-opt=save-temps \ ; RUN: -shared %t.o -o %t2.o ; RUN: llvm-dis %t2.o.opt.bc -o - | FileCheck %s @@ -17,8 +17,8 @@ bb: bb1: %i.0 = phi i64 [ 0, %bb ], [ %tmp4, %bb1 ] - %tmp = getelementptr inbounds float* %x, i64 %i.0 - %tmp2 = load float* %tmp, align 4 + %tmp = getelementptr inbounds float, float* %x, i64 %i.0 + %tmp2 = load float, float* %tmp, align 4 %tmp3 = fadd float %tmp2, 1.000000e+00 store float %tmp3, float* %tmp, align 4 %tmp4 = add nsw i64 %i.0, 1 |