Skip to content

Commit 499965e

Browse files
committed
add test
1 parent f2e6584 commit 499965e

File tree

1 file changed

+44
-0
lines changed

1 file changed

+44
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
; RUN: opt -S -o - %s -passes=simplifycfg -simplifycfg-require-and-preserve-domtree=1 | FileCheck %s
2+
3+
4+
declare i1 @make_condition()
5+
6+
define i1 @specfn() readnone nounwind speculatable {
7+
ret i1 true
8+
}
9+
10+
; CHECK-LABEL: @test1(
11+
; CHECK: call i1 @specfn(), !dbg
12+
; CHECK: select i1 [[COND]]
13+
define void @test1() !dbg !6 {
14+
start:
15+
%cond = call i1 @make_condition(), !dbg !8
16+
br i1 %cond, label %then, label %else, !dbg !9
17+
18+
then: ; preds = %start
19+
%sres = call i1 @specfn(), !dbg !8
20+
br label %else, !dbg !11
21+
22+
else: ; preds = %then, %start
23+
%phi = phi i1 [ %cond, %start ], [ %sres, %then ], !dbg !12
24+
ret void, !dbg !13
25+
}
26+
27+
!llvm.dbg.cu = !{!0}
28+
!llvm.debugify = !{!3, !4}
29+
!llvm.module.flags = !{!5}
30+
31+
!0 = distinct !DICompileUnit(language: DW_LANG_C, file: !1, producer: "debugify", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
32+
!1 = !DIFile(filename: "test.ll", directory: "/")
33+
!2 = !{}
34+
!3 = !{i32 6}
35+
!4 = !{i32 0}
36+
!5 = !{i32 2, !"Debug Info Version", i32 3}
37+
!6 = distinct !DISubprogram(name: "test1", linkageName: "test1", scope: null, file: !1, line: 1, type: !7, scopeLine: 1, spFlags: DISPFlagDefinition | DISPFlagOptimized, unit: !0, retainedNodes: !2)
38+
!7 = !DISubroutineType(types: !2)
39+
!8 = !DILocation(line: 1, column: 1, scope: !6)
40+
!9 = !DILocation(line: 2, column: 1, scope: !6)
41+
!10 = !DILocation(line: 3, column: 2, scope: !6)
42+
!11 = !DILocation(line: 4, column: 2, scope: !6)
43+
!12 = !DILocation(line: 5, column: 3, scope: !6)
44+
!13 = !DILocation(line: 6, column: 3, scope: !6)

0 commit comments

Comments
 (0)