Home | History | Annotate | Download | only in X86
      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 declare i32 @bar()
     36 
     37 define i32 @foo() {
     38   %a = call i32 @bar()
     39   ret i32 %a
     40 }
     41 
     42 define i32 @main() {
     43   %i = call i32 @foo()
     44   ret i32 %i
     45 }
     46