blob: 3ff4753200ef60b62676d174aacaa4af976731ee [file] [log] [blame]
Kyle Butt0846e562016-10-11 20:36:43 +00001; RUN: llc -O2 %s -o - | FileCheck %s
2target datalayout = "E-m:e-i64:64-n32:64"
3target triple = "powerpc64-unknown-linux-gnu"
4
5; Function Attrs: nounwind
Matt Arsenaultf10061e2017-04-10 20:18:21 +00006declare void @llvm.lifetime.end.p0i8(i64, i8* nocapture) #0
Kyle Butt0846e562016-10-11 20:36:43 +00007
8declare void @f1()
9declare void @f2()
10declare void @f3()
11declare void @f4()
12
13; Function Attrs: nounwind
14; CHECK-LABEL: tail_dup_fallthrough_with_branch
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000015; CHECK: # %bb.{{[0-9]+}}: # %entry
Kyle Butt0846e562016-10-11 20:36:43 +000016; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000017; CHECK: # %bb.{{[0-9]+}}: # %entry
Kyle Butt0846e562016-10-11 20:36:43 +000018; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000019; CHECK: # %bb.{{[0-9]+}}: # %sw.0
Kyle Butt0846e562016-10-11 20:36:43 +000020; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
21; CHECK: # %sw.1
22; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
23; CHECK: # %sw.default
24; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
Francis Visoiu Mistrih25528d62017-12-04 17:18:51 +000025; CHECK: # %bb.{{[0-9]+}}: # %if.then
Kyle Butt0846e562016-10-11 20:36:43 +000026; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
27; CHECK: # %if.else
28; CHECK-NOT: # %{{[-_a-zA-Z0-9]+}}
29; CHECK: .Lfunc_end0
30define fastcc void @tail_dup_fallthrough_with_branch(i32 %a, i1 %b) unnamed_addr #0 {
31entry:
32 switch i32 %a, label %sw.default [
33 i32 0, label %sw.0
34 i32 1, label %sw.1
35 ]
36
37sw.0: ; preds = %entry
38 call void @f1() #0
39 br label %dup1
40
41sw.1: ; preds = %entry
42 call void @f2() #0
43 br label %dup1
44
45sw.default: ; preds = %entry
46 br i1 %b, label %if.then, label %if.else
47
48if.then: ; preds = %sw.default
49 call void @f3() #0
50 br label %dup2
51
52if.else: ; preds = %sw.default
53 call void @f4() #0
54 br label %dup2
55
56dup1: ; preds = %sw.0, %sw.1
Matt Arsenaultf10061e2017-04-10 20:18:21 +000057 call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull undef) #0
Kyle Butt0846e562016-10-11 20:36:43 +000058 unreachable
59
60dup2: ; preds = %if.then, %if.else
Matt Arsenaultf10061e2017-04-10 20:18:21 +000061 call void @llvm.lifetime.end.p0i8(i64 8, i8* nonnull undef) #0
Kyle Butt0846e562016-10-11 20:36:43 +000062 unreachable
63}
64
65attributes #0 = { nounwind }