blob: d2f6854bd3cdd65b736d000d80cbc21371c2db68 [file] [log] [blame]
Johannes Doerfert9543f142019-08-23 15:24:57 +00001; RUN: opt < %s -attributor -attributor-disable=false -attributor-max-iterations=0 -S | FileCheck %s
2; RUN: opt < %s -attributor -attributor-disable=false -attributor-max-iterations=1 -S | FileCheck %s
3; RUN: opt < %s -attributor -attributor-disable=false -attributor-max-iterations=2 -S | FileCheck %s
4; RUN: opt < %s -attributor -attributor-disable=false -attributor-max-iterations=3 -S | FileCheck %s
5; RUN: opt < %s -attributor -attributor-disable=false -attributor-max-iterations=4 -S | FileCheck %s
6; RUN: opt < %s -attributor -attributor-disable=false -attributor-max-iterations=2147483647 -S | FileCheck %s
7
8; CHECK-NOT: Function
9; CHECK: declare i32 @foo1()
10; CHECK-NOT: Function
11; CHECK: declare i32 @foo2()
12; CHECK-NOT: Function
13; CHECK: declare i32 @foo3()
14declare i32 @foo1()
15declare i32 @foo2()
16declare i32 @foo3()
17
18; CHECK-NOT: Function
19; CHECK: define internal i32 @bar() {
20; CHECK-NEXT: %1 = call i32 @foo1()
21; CHECK-NEXT: %2 = call i32 @foo2()
22; CHECK-NEXT: %3 = call i32 @foo3()
23; CHECK-NEXT: ret i32 1
24; CHECK-NEXT: }
25define internal i32 @bar() {
26 %1 = call i32 @foo1()
27 %2 = call i32 @foo2()
28 %3 = call i32 @foo3()
29 ret i32 1
30}
31
32; CHECK-NOT: Function
33; CHECK: define i32 @baz() {
34; CHECK-NEXT: %1 = call i32 @bar()
35; CHECK-NEXT: ret i32 0
36; CHECK-NEXT: }
37define i32 @baz() {
38 %1 = call i32 @bar()
39 ret i32 0
40}
41
42; We should never derive anything here
43; CHECK-NOT: attributes