• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt < %s -tailcallelim -S | FileCheck %s
2
3; Test that we don't tail call in a functions that calls returns_twice
4; functions.
5
6declare void @bar()
7
8; CHECK: foo1
9; CHECK-NOT: tail call void @bar()
10
11define void @foo1(i32* %x) {
12bb:
13  %tmp75 = tail call i32 @setjmp(i32* %x)
14  call void @bar()
15  ret void
16}
17
18declare i32 @setjmp(i32*) returns_twice
19
20; CHECK: foo2
21; CHECK-NOT: tail call void @bar()
22
23define void @foo2(i32* %x) {
24bb:
25  %tmp75 = tail call i32 @zed2(i32* %x)
26  call void @bar()
27  ret void
28}
29declare i32 @zed2(i32*) returns_twice
30