blob: 566b206919e1a336e98bfde8fdf4a6fd8debcb4e [file] [log] [blame]
Diego Novilloc6574c12014-04-08 16:42:38 +00001; RUN: opt < %s -inline -pass-remarks='inline' -S 2>&1 | FileCheck %s
2; RUN: opt < %s -inline -pass-remarks='inl.*' -S 2>&1 | FileCheck %s
3; RUN: opt < %s -inline -pass-remarks='vector' -pass-remarks='inl' -S 2>&1 | FileCheck %s
Diego Novillodd491572014-05-06 19:14:00 +00004
5; These two should not yield an inline remark for the same reason.
6; In the first command, we only ask for vectorizer remarks, in the
7; second one we ask for the inliner, but we then ask for the vectorizer
8; (thus overriding the first flag).
Diego Novilloc6574c12014-04-08 16:42:38 +00009; RUN: opt < %s -inline -pass-remarks='vector' -S 2>&1 | FileCheck --check-prefix=REMARKS %s
Diego Novillodd491572014-05-06 19:14:00 +000010; RUN: opt < %s -inline -pass-remarks='inl' -pass-remarks='vector' -S 2>&1 | FileCheck --check-prefix=REMARKS %s
11
Diego Novilloc6574c12014-04-08 16:42:38 +000012; RUN: opt < %s -inline -S 2>&1 | FileCheck --check-prefix=REMARKS %s
13; RUN: not opt < %s -pass-remarks='(' 2>&1 | FileCheck --check-prefix=BAD-REGEXP %s
14
15define i32 @foo(i32 %x, i32 %y) #0 {
16entry:
17 %x.addr = alloca i32, align 4
18 %y.addr = alloca i32, align 4
19 store i32 %x, i32* %x.addr, align 4
20 store i32 %y, i32* %y.addr, align 4
21 %0 = load i32* %x.addr, align 4
22 %1 = load i32* %y.addr, align 4
23 %add = add nsw i32 %0, %1
24 ret i32 %add
25}
26
27define i32 @bar(i32 %j) #0 {
28entry:
29 %j.addr = alloca i32, align 4
30 store i32 %j, i32* %j.addr, align 4
31 %0 = load i32* %j.addr, align 4
32 %1 = load i32* %j.addr, align 4
33 %sub = sub nsw i32 %1, 2
34 %call = call i32 @foo(i32 %0, i32 %sub)
35; CHECK: foo inlined into bar
36; REMARKS-NOT: foo inlined into bar
37 ret i32 %call
38}
39
40; BAD-REGEXP: Invalid regular expression '(' in -pass-remarks: