@@ -5,9 +5,16 @@ declare void @foo(i32)
5
5
define void @test1 (i32 noundef %gid ) !dbg !3 {
6
6
entry:
7
7
;
8
- ; verify that debug info exists for "xyz" variable
8
+ ; Equivalent of code:
9
+ ; extern void foo(int);
10
+ ; void test_kernel_bool(int a) {
11
+ ; bool xyz = a == 0;
12
+ ; foo(xyz);
13
+ ; }
9
14
;
10
- ; CHECK-LABEL: DW_TAG_variable
15
+ ; Verify that debug info exists for "xyz" variable
16
+ ;
17
+ ; CHECK: DW_TAG_variable
11
18
; CHECK: .b8 120 // DW_AT_name
12
19
; CHECK-NEXT: .b8 121
13
20
; CHECK-NEXT: .b8 122
@@ -24,6 +31,35 @@ entry:
24
31
ret void
25
32
}
26
33
34
+ define void @test2 (i32 noundef %gid ) !dbg !14 {
35
+ entry:
36
+ ;
37
+ ; Equivalent of code:
38
+ ; extern void foo(int);
39
+ ; void test_kernel_bool(int a) {
40
+ ; unsigned char abc = a == 0;
41
+ ; foo(abc);
42
+ ; }
43
+ ;
44
+ ; Verify that debug info exists for "abc" variable
45
+ ;
46
+ ; CHECK: DW_TAG_variable
47
+ ; CHECK: .b8 97 // DW_AT_name
48
+ ; CHECK-NEXT: .b8 98
49
+ ; CHECK-NEXT: .b8 99
50
+ ; CHECK-NEXT: .b8 0
51
+ ; CHECK-NEXT: .b8 1 // DW_AT_decl_file
52
+ ; CHECK-NEXT: .b8 11 // DW_AT_decl_line
53
+ ;
54
+ %cmp = icmp eq i32 %gid , 0 , !dbg !17
55
+ %conv = zext i1 %cmp to i32 , !dbg !17
56
+ %conv1 = trunc i32 %conv to i8 , !dbg !17
57
+ #dbg_value(i8 %conv1 , !16 , !DIExpression (), !18 )
58
+ %conv3 = zext i8 %conv1 to i32
59
+ call void @foo (i32 %conv3 )
60
+ ret void
61
+ }
62
+
27
63
!llvm.dbg.cu = !{!0 }
28
64
!llvm.module.flags = !{!2 }
29
65
41
77
!11 = !DIBasicType (name: "bool" , size: 8 , encoding: DW_ATE_boolean)
42
78
!12 = !DILocation (line: 1 , column: 3 , scope: !9 )
43
79
!13 = !DILocation (line: 2 , scope: !9 )
80
+ !14 = distinct !DISubprogram (name: "test2" , linkageName: "_test2i" , scope: !1 , file: !1 , line: 10 , type: !4 , scopeLine: 10 , unit: !0 , retainedNodes: !8 )
81
+ !15 = distinct !DILexicalBlock (scope: !14 , file: !1 , line: 10 , column: 30 )
82
+ !16 = !DILocalVariable (name: "abc" , scope: !15 , file: !1 , line: 11 , type: !11 )
83
+ !17 = !DILocation (line: 11 , column: 3 , scope: !15 )
84
+ !18 = !DILocation (line: 12 , scope: !15 )
0 commit comments