| Johannes Doerfert | 9543f14 | 2019-08-23 15:24:57 +0000 | [diff] [blame] | 1 | ; 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() |
| 14 | declare i32 @foo1() |
| 15 | declare i32 @foo2() |
| 16 | declare 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: } |
| 25 | define 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: } |
| 37 | define i32 @baz() { |
| 38 | %1 = call i32 @bar() |
| 39 | ret i32 0 |
| 40 | } |
| 41 | |
| 42 | ; We should never derive anything here |
| 43 | ; CHECK-NOT: attributes |