• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1; RUN: opt -tailcallelim -S < %s | FileCheck %s
2; XFAIL: *
3
4declare void @use(i8* nocapture, i8* nocapture)
5
6define i8* @foo(i8* nocapture %A, i1 %cond) {
7; CHECK: tailrecurse:
8; CHECK: %A.tr = phi i8* [ %A, %0 ], [ %B, %cond_true ]
9; CHECK: %cond.tr = phi i1 [ %cond, %0 ], [ false, %cond_true ]
10  %B = alloca i8
11; CHECK: %B = alloca i8
12  br i1 %cond, label %cond_true, label %cond_false
13; CHECK: br i1 %cond.tr, label %cond_true, label %cond_false
14cond_true:
15; CHECK: cond_true:
16; CHECK: br label %tailrecurse
17  call i8* @foo(i8* %B, i1 false)
18  ret i8* null
19cond_false:
20; CHECK: cond_false
21  call void @use(i8* %A, i8* %B)
22; CHECK: tail call void @use(i8* %A.tr, i8* %B)
23  ret i8* null
24; CHECK: ret i8* null
25}
26