59 lines · plain
1; RUN: llvm-as -o %t.bc %s2; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \3; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \4; RUN: -plugin-opt=O0 -r -o %t.o %t.bc5; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s6; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \7; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \8; RUN: -plugin-opt=O1 -r -o %t.o %t.bc9; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 %s10; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \11; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \12; RUN: -plugin-opt=O2 -r -o %t.o %t.bc13; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s14 15; CHECK-O0: define internal void @foo(16; CHECK-O1: define internal void @foo(17; CHECK-O2-NOT: define internal void @foo(18 19target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"20target triple = "x86_64-unknown-linux-gnu"21 22define internal void @foo() {23 ret void24}25 26; CHECK-O0: define internal i32 @bar(27; CHECK-O1: define internal i32 @bar(28define internal i32 @bar(i1 %p) {29 br i1 %p, label %t, label %f30 31t:32 br label %end33 34f:35 br label %end36 37end:38 ; CHECK-O0: phi39 ; CHECK-O1: phi40 %r = phi i32 [ 1, %t ], [ 2, %f ]41 ret i32 %r42}43 44define i1 @baz() {45 call void @foo()46 %c = call i32 @bar(i1 true)47 %p = call i1 @llvm.type.test(ptr undef, metadata !"typeid1")48 ret i1 %p49}50 51; CHECK-O0-NOT: !type52; CHECK-O1-NOT: !type53; CHECK-O2-NOT: !type54@a = constant i32 1, !type !055 56!0 = !{i32 0, !"typeid1"}57 58declare i1 @llvm.type.test(ptr %ptr, metadata %bitset) nounwind readnone59