xref: /llvm-project/llvm/test/Transforms/SimplifyCFG/debug-info-thread-phi.ll (revision d2d9dc8eb4126271ee1406c2586a4953db831d21)
1; RUN: opt %s -passes=debugify,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S | FileCheck %s
2; RUN: opt %s -passes=debugify,simplifycfg -simplifycfg-require-and-preserve-domtree=1 -S --try-experimental-debuginfo-iterators | FileCheck %s
3; Tests Bug 37966
4
5define void @bar(i32 %aa) {
6; CHECK-LABEL: @bar(
7; CHECK: if.end.1.critedge:
8; CHECK: br label %if.end.1, !dbg ![[DBG:[0-9]+]]
9entry:
10  %aa.addr = alloca i32, align 4
11  %bb = alloca i32, align 4
12  store i32 %aa, ptr %aa.addr, align 4
13  store i32 0, ptr %bb, align 4
14  %tobool = icmp ne i32 %aa, 0
15  br i1 %tobool, label %if.then, label %if.end
16
17if.then:                                          ; preds = %entry
18  call void @foo()
19  br label %if.end
20
21if.end:                                           ; preds = %if.then, %entry
22  store i32 1, ptr %bb, align 4
23  br i1 %tobool, label %if.then.1, label %if.end.1 ; "line 10" to -debugify
24
25if.then.1:                                        ; preds = %if.end
26  call void @foo()
27  br label %if.end.1
28
29if.end.1:                                         ; preds = %if.then.1, %if.end
30  store i32 2, ptr %bb, align 4
31  br label %for.end
32
33for.end:                                          ; preds = %if.end.1
34  ret void
35}
36
37declare void @foo()
38
39; CHECK: ![[DBG]] = !DILocation(line: 10,
40