1 ; RUN: llvm-as -o %t.bc %s
2 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \
4 ; RUN: -plugin-opt=O0 -r -o %t.o %t.bc
5 ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s
6 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \
8 ; RUN: -plugin-opt=O1 -r -o %t.o %t.bc
9 ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 --check-prefix=CHECK-O1-OLDPM %s
10 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \
11 ; RUN: -m elf_x86_64 \
12 ; RUN: -plugin-opt=O2 -r -o %t.o %t.bc
13 ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s
15 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \
16 ; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \
17 ; RUN: -plugin-opt=O0 -r -o %t.o %t.bc
18 ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O0 %s
19 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \
20 ; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \
21 ; RUN: -plugin-opt=O1 -r -o %t.o %t.bc
22 ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O1 --check-prefix=CHECK-O1-NEWPM %s
23 ; RUN: %gold -plugin %llvmshlibdir/LLVMgold%shlibext -plugin-opt=save-temps \
24 ; RUN: -m elf_x86_64 --plugin-opt=new-pass-manager \
25 ; RUN: -plugin-opt=O2 -r -o %t.o %t.bc
26 ; RUN: llvm-dis < %t.o.0.4.opt.bc -o - | FileCheck --check-prefix=CHECK-O2 %s
28 ; CHECK-O0: define internal void @foo(
29 ; CHECK-O1: define internal void @foo(
30 ; CHECK-O2-NOT: define internal void @foo(
32 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
33 target triple = "x86_64-unknown-linux-gnu"
35 define internal void @foo() {
39 ; CHECK-O0: define internal i32 @bar(
40 ; CHECK-O1: define internal i32 @bar(
41 define internal i32 @bar(i1 %p) {
42 br i1 %p, label %t, label %f
52 ; CHECK-O1-OLDPM: select
53 ; The new PM does not do as many optimizations at O1
55 %r = phi i32 [ 1, %t ], [ 2, %f ]
61 %c = call i32 @bar(i1 true)
62 %p = call i1 @llvm.type.test(i8* undef, metadata !"typeid1")
69 @a = constant i32 1, !type !0
71 !0 = !{i32 0, !"typeid1"}
73 declare i1 @llvm.type.test(i8* %ptr, metadata %bitset) nounwind readnone