misched: Add register pressure backoff to ConvergingScheduler.
[oota-llvm.git] / test / Transforms / Inline / inline_returns_twice.ll
1 ; RUN: opt < %s -inline -S | FileCheck %s
2
3 ; Check that functions with "returns_twice" calls are only inlined,
4 ; if they are themselve marked as such.
5
6 declare i32 @a() returns_twice
7 declare i32 @b() returns_twice
8
9 define i32 @f() {
10 entry:
11   %call = call i32 @a() returns_twice
12   %add = add nsw i32 1, %call
13   ret i32 %add
14 }
15
16 define i32 @g() {
17 entry:
18 ; CHECK: define i32 @g
19 ; CHECK: call i32 @f()
20 ; CHECK-NOT: call i32 @a()
21   %call = call i32 @f()
22   %add = add nsw i32 1, %call
23   ret i32 %add
24 }
25
26 define i32 @h() returns_twice {
27 entry:
28   %call = call i32 @b() returns_twice
29   %add = add nsw i32 1, %call
30   ret i32 %add
31 }
32
33 define i32 @i() {
34 entry:
35 ; CHECK: define i32 @i
36 ; CHECK: call i32 @b()
37 ; CHECK-NOT: call i32 @h()
38   %call = call i32 @h() returns_twice
39   %add = add nsw i32 1, %call
40   ret i32 %add
41 }