blob: 03db4a722b5d566d08efc9c2d3c882a6a4a8e1c7 [file] [log] [blame]
Teresa Johnson85cc2982018-05-03 20:24:12 +00001; Test of LTO with opt remarks YAML output.
Davide Italianoebd47192017-02-12 03:31:30 +00002
Teresa Johnson85cc2982018-05-03 20:24:12 +00003; First try with Regular LTO
4; RUN: llvm-as < %s >%t.bc
Davide Italianoebd47192017-02-12 03:31:30 +00005; RUN: rm -f %t.yaml
Peter Collingbourne7faa60c2017-04-11 18:12:00 +00006; RUN: llvm-lto2 run -pass-remarks-output=%t.yaml \
Davide Italianoebd47192017-02-12 03:31:30 +00007; RUN: -r %t.bc,tinkywinky,p \
8; RUN: -r %t.bc,patatino,px \
Davide Italiano77d42ea2017-02-12 05:43:25 +00009; RUN: -r %t.bc,main,px -o %t.o %t.bc
Davide Italianoebd47192017-02-12 03:31:30 +000010; RUN: cat %t.yaml | FileCheck %s -check-prefix=YAML
11
Teresa Johnson85cc2982018-05-03 20:24:12 +000012; 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
Davide Italianoebd47192017-02-12 03:31:30 +000021; 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
David Bolvanskyc0aa4b72018-08-05 14:53:08 +000029; YAML-NEXT: - String: ' with '
30; YAML-NEXT: - String: '(cost='
Sam Elliotte604b562017-08-21 16:45:47 +000031; YAML-NEXT: - Cost: '-15000'
David Bolvanskyc0aa4b72018-08-05 14:53:08 +000032; YAML-NEXT: - String: ', threshold='
Sam Elliotte604b562017-08-21 16:45:47 +000033; YAML-NEXT: - Threshold: '337'
34; YAML-NEXT: - String: ')'
Davide Italianoebd47192017-02-12 03:31:30 +000035; YAML-NEXT: ...
36
37target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
38target triple = "x86_64-scei-ps4"
39
40declare i32 @patatino()
41
42define i32 @tinkywinky() {
43 %a = call i32 @patatino()
44 ret i32 %a
45}
46
47define i32 @main() {
48 %i = call i32 @tinkywinky()
49 ret i32 %i
50}