1; RUN: opt < %s -simplifycfg -S | FileCheck %s
2; RUN: opt < %s -passes=simplifycfg -S | FileCheck %s
3
4; XFAIL: *
5; REQUIRES: asserts
6; FIXME: Fails due to infinite loop in iterativelySimplifyCFG.
7
8; ModuleID = 'test/Transforms/SimplifyCFG/pr-new.ll'
9source_filename = "test/Transforms/SimplifyCFG/pr-new.ll"
10
11define i32 @test(float %arg) gc "statepoint-example" personality i32* ()* @blam {
12; CHECK-LABEL: @test
13bb:
14  %tmp = call i1 @llvm.experimental.widenable.condition()
15  br i1 %tmp, label %bb2, label %bb1
16
17bb1:                                              ; preds = %bb
18  br i1 undef, label %bb7, label %bb5
19
20bb2:                                              ; preds = %bb
21  %tmp3 = getelementptr inbounds i8, i8 addrspace(1)* undef, i64 16
22  br i1 undef, label %bb6, label %bb4
23
24bb4:                                              ; preds = %bb2
25  call void @snork() [ "deopt"() ]
26  unreachable
27
28bb5:                                              ; preds = %bb1
29  ret i32 0
30
31bb6:                                              ; preds = %bb2
32  br label %bb7
33
34bb7:                                              ; preds = %bb6, %bb1
35  %tmp8 = call i32 (...) @llvm.experimental.deoptimize.i32(i32 10) [ "deopt"() ]
36  ret i32 %tmp8
37}
38
39declare i32* @blam()
40
41declare void @snork()
42
43declare i32 @llvm.experimental.deoptimize.i32(...)
44
45; Function Attrs: inaccessiblememonly nofree nosync nounwind speculatable willreturn
46declare i1 @llvm.experimental.widenable.condition() #0
47
48attributes #0 = { inaccessiblememonly nofree nosync nounwind speculatable willreturn }
49
50