690a9014a7e12d48f88f880439165dc8805fde04
[oota-llvm.git] / test / LTO / X86 / diagnostic-handler-remarks.ll
1 ; RUN: llvm-as < %s >%t.bc
2 ; PR21108: Diagnostic handlers get pass remarks, even if they're not enabled.
3
4 ; Confirm that there are -pass-remarks.
5 ; RUN: llvm-lto -pass-remarks=inline \
6 ; RUN:          -exported-symbol _main -o %t.o %t.bc 2>&1 | \
7 ; RUN:     FileCheck %s -allow-empty -check-prefix=REMARKS
8 ; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
9
10 ; RUN: llvm-lto -pass-remarks=inline -use-diagnostic-handler \
11 ; RUN:         -exported-symbol _main -o %t.o %t.bc 2>&1 | \
12 ; RUN:     FileCheck %s -allow-empty -check-prefix=REMARKS_DH
13 ; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
14
15 ; Confirm that -pass-remarks are not printed by default.
16 ; RUN: llvm-lto \
17 ; RUN:         -exported-symbol _main -o %t.o %t.bc 2>&1 | \
18 ; RUN:     FileCheck %s -allow-empty
19 ; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
20
21 ; RUN: llvm-lto -use-diagnostic-handler \
22 ; RUN:         -exported-symbol _main -o %t.o %t.bc 2>&1 | \
23 ; RUN:     FileCheck %s -allow-empty
24 ; RUN: llvm-nm %t.o | FileCheck %s -check-prefix NM
25
26 ; REMARKS: remark:
27 ; REMARKS_DH: llvm-lto: remark:
28 ; CHECK-NOT: remark:
29 ; CHECK-NOT: llvm-lto:
30 ; NM-NOT: foo
31 ; NM: main
32
33 target triple = "x86_64-apple-darwin"
34
35 define i32 @foo() {
36   ret i32 7
37 }
38
39 define i32 @main() {
40   %i = call i32 @foo()
41   ret i32 %i
42 }