]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/LTO/Resolution/X86/diagnostic-handler-remarks.ll
Vendor import of llvm trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / LTO / Resolution / X86 / diagnostic-handler-remarks.ll
1 ; Test of LTO with opt remarks YAML output.
2
3 ; First try with Regular LTO
4 ; RUN: llvm-as < %s >%t.bc
5 ; RUN: rm -f %t.yaml
6 ; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
7 ; RUN:           -r %t.bc,tinkywinky,p \
8 ; RUN:           -r %t.bc,patatino,px \
9 ; RUN:           -r %t.bc,main,px -o %t.o %t.bc
10 ; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
11
12 ; Try again with ThinLTO
13 ; RUN: opt -module-summary %s -o %t.bc
14 ; RUN: rm -f %t.thin.1.yaml
15 ; RUN: llvm-lto2 run -pass-remarks-output=%t \
16 ; RUN:           -r %t.bc,tinkywinky,p \
17 ; RUN:           -r %t.bc,patatino,px \
18 ; RUN:           -r %t.bc,main,px -o %t.o %t.bc
19 ; RUN: cat %t.thin.1.yaml | FileCheck %s -check-prefix=YAML
20
21 ; YAML:      --- !Passed
22 ; YAML-NEXT: Pass:            inline
23 ; YAML-NEXT: Name:            Inlined
24 ; YAML-NEXT: Function:        main
25 ; YAML-NEXT: Args:
26 ; YAML-NEXT:   - Callee:          tinkywinky
27 ; YAML-NEXT:   - String:          ' inlined into '
28 ; YAML-NEXT:   - Caller:          main
29 ; YAML-NEXT:   - String:          ' with '
30 ; YAML-NEXT:   - String:          '(cost='
31 ; YAML-NEXT:   - Cost:            '-15000'
32 ; YAML-NEXT:   - String:          ', threshold='
33 ; YAML-NEXT:   - Threshold:       '337'
34 ; YAML-NEXT:   - String:          ')'
35 ; YAML-NEXT: ...
36
37 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
38 target triple = "x86_64-scei-ps4"
39
40 declare i32 @patatino()
41
42 define i32 @tinkywinky() {
43   %a = call i32 @patatino()
44   ret i32 %a
45 }
46
47 define i32 @main() {
48   %i = call i32 @tinkywinky()
49   ret i32 %i
50 }