1 ; RUN: opt < %s -inline -S | FileCheck %s
3 ; Check that functions with "returns_twice" calls are only inlined,
4 ; if they are themselve marked as such.
6 declare i32 @a() returns_twice
7 declare i32 @b() returns_twice
11 %call = call i32 @a() returns_twice
12 %add = add nsw i32 1, %call
18 ; CHECK-LABEL: define i32 @g(
19 ; CHECK: call i32 @f()
20 ; CHECK-NOT: call i32 @a()
22 %add = add nsw i32 1, %call
26 define i32 @h() returns_twice {
28 %call = call i32 @b() returns_twice
29 %add = add nsw i32 1, %call
35 ; CHECK-LABEL: 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