Debian Codegraph @

llvm/test/tools/llvm-lto2/X86/pipeline.ll

raw
1 ; RUN: llvm-as < %s > %t1.bc
2
3 ; Try the default pipeline and check is BasicAA is invoked.
4 ; RUN: llvm-lto2 run %t1.bc -o %t.o -r %t1.bc,patatino,px -debug-pass-manager \
5 ; RUN: 2>&1 | FileCheck %s --check-prefix=DEFAULT
6 ; DEFAULT: Running analysis: BasicAA on patatino
7
8 ; Try a custom pipeline
9 ; RUN: llvm-lto2 run %t1.bc -o %t.o -save-temps \
10 ; RUN: -r %t1.bc,patatino,px -opt-pipeline lower-atomic \
11 ; RUN: -aa-pipeline basic-aa
12 ; RUN: llvm-dis < %t.o.0.4.opt.bc | FileCheck %s --check-prefix=CUSTOM
13
14 ; Try the new pass manager LTO default pipeline (make sure the option
15 ; is accepted).
16 ; RUN: llvm-lto2 run %t1.bc -o %t.o -r %t1.bc,patatino,px
17
18 target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
19 target triple = "x86_64-unknown-linux-gnu"
20
21 define void @patatino() {
22 fence seq_cst
23 ret void
24 }
25
26 ; CUSTOM: define void @patatino() {
27 ; CUSTOM-NEXT: ret void
28 ; CUSTOM-NEXT: }
29
30 ; Check that invalid pipelines are caught as errors.
31 ; RUN: not --crash llvm-lto2 run %t1.bc -o %t.o \
32 ; RUN: -r %t1.bc,patatino,px -opt-pipeline foogoo 2>&1 | \
33 ; RUN: FileCheck %s --check-prefix=ERR
34
35 ; ERR: LLVM ERROR: unable to parse pass pipeline description 'foogoo': unknown pass name 'foogoo'
36
37 ; RUN: not --crash llvm-lto2 run %t1.bc -o %t.o \
38 ; RUN: -r %t1.bc,patatino,px -aa-pipeline patatino \
39 ; RUN: -opt-pipeline lower-atomic 2>&1 | \
40 ; RUN: FileCheck %s --check-prefix=AAERR
41
42 ; AAERR: LLVM ERROR: unable to parse AA pipeline description 'patatino': unknown alias analysis name 'patatino'