|
20 | 20 | ; int squared = square(i);
|
21 | 21 | ; return squared*i;
|
22 | 22 | ; }
|
| 23 | +; |
| 24 | +; int boo(int, int) {} |
23 | 25 |
|
24 | 26 | ; Following variables/arguments/members should be counted:
|
25 | 27 | ; - GlobalConst,
|
26 | 28 | ; - Global,
|
27 | 29 | ; - s, s.constant,
|
28 | 30 | ; - square::i,
|
29 | 31 | ; - cube::i, cube::squared
|
| 32 | +; - boo::1, boo::2 |
30 | 33 | ; Skipped entities:
|
31 | 34 | ; - declaration of test::a,
|
32 | 35 | ; - non-constant member S:fn,
|
33 | 36 | ; - arguments of S:fn.
|
34 | 37 |
|
35 |
| -; CHECK: "unique source variables":7 |
| 38 | +; CHECK: "unique source variables":9 |
36 | 39 | ; +1 extra inline i.
|
37 |
| -; CHECK: "source variables":8 |
| 40 | +; CHECK: "source variables":10 |
38 | 41 | ; -1 square::i
|
39 |
| -; CHECK: "variables with location":7 |
| 42 | +; CHECK: "variables with location":9 |
40 | 43 | ; CHECK: "scope bytes total":[[BYTES:[0-9]+]]
|
41 | 44 | ; Because of the dbg.value in the middle of the function, the pc range coverage
|
42 | 45 | ; must be below 100%.
|
@@ -99,6 +102,18 @@ entry:
|
99 | 102 | ret i32 %mul, !dbg !44
|
100 | 103 | }
|
101 | 104 |
|
| 105 | +; Function Attrs: noinline optnone uwtable |
| 106 | +define dso_local i32 @_Z3booii(i32 %0, i32 %1) !dbg !52 { |
| 107 | +entry: |
| 108 | + %.addr = alloca i32, align 4 |
| 109 | + %.addr1 = alloca i32, align 4 |
| 110 | + store i32 %0, i32* %.addr, align 4 |
| 111 | + call void @llvm.dbg.declare(metadata i32* %.addr, metadata !55, metadata !DIExpression()), !dbg !56 |
| 112 | + store i32 %1, i32* %.addr1, align 4 |
| 113 | + call void @llvm.dbg.declare(metadata i32* %.addr1, metadata !57, metadata !DIExpression()), !dbg !58 |
| 114 | + ret i32 0, !dbg !58 |
| 115 | +} |
| 116 | + |
102 | 117 | attributes #0 = { alwaysinline nounwind ssp uwtable }
|
103 | 118 | attributes #1 = { nounwind readnone speculatable }
|
104 | 119 | attributes #2 = { noinline nounwind optnone ssp uwtable }
|
@@ -159,3 +174,10 @@ attributes #2 = { noinline nounwind optnone ssp uwtable }
|
159 | 174 | !49 = !DIImportedEntity(tag: DW_TAG_imported_declaration, scope: !2, entity: !50, file: !3, line: 2)
|
160 | 175 | !50 = !DIGlobalVariable(name: "a", linkageName: "_ZN4test1aE", scope: !51, file: !3, line: 2, type: !8, isLocal: false, isDefinition: false)
|
161 | 176 | !51 = !DINamespace(name: "test", scope: !2)
|
| 177 | +!52 = distinct !DISubprogram(name: "boo", linkageName: "_Z3booii", scope: !3, file: !3, line: 10, type: !53, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !4) |
| 178 | +!53 = !DISubroutineType(types: !54) |
| 179 | +!54 = !{!8, !8, !8} |
| 180 | +!55 = !DILocalVariable(arg: 1, scope: !52, file: !3, line: 10, type: !8) |
| 181 | +!56 = !DILocation(line: 10, column: 12, scope: !52) |
| 182 | +!57 = !DILocalVariable(arg: 2, scope: !52, file: !3, line: 10, type: !8) |
| 183 | +!58 = !DILocation(line: 10, column: 17, scope: !52) |
0 commit comments