|
3 | 3 |
|
4 | 4 | ; C++ source to regenerate:
|
5 | 5 | ; const int Test1 = 1;
|
| 6 | +; struct Foo { static const int Test2 = 2; }; |
6 | 7 | ; int main() {
|
7 |
| -; return Test1; |
| 8 | +; return Test1 + Foo::Test2; |
8 | 9 | ; }
|
9 | 10 | ; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
|
10 | 11 |
|
11 |
| -; ASM-LABEL: .long 241 # Symbol subsection for globals |
| 12 | +; ASM-LABEL: .long 241 # Symbol subsection for globals |
12 | 13 |
|
13 |
| -; ASM: .short {{.*-.*}} # Record length |
14 |
| -; ASM: .short 4359 # Record kind: S_CONSTANT |
15 |
| -; ASM-NEXT: .long 4099 # Type |
16 |
| -; ASM-NEXT: .byte 0x01, 0x00 # Value |
17 |
| -; ASM-NEXT: .asciz "Test1" # Name |
| 14 | +; ASM: .short {{.*-.*}} # Record length |
| 15 | +; ASM: .short 4359 # Record kind: S_CONSTANT |
| 16 | +; ASM-NEXT: .long 4099 # Type |
| 17 | +; ASM-NEXT: .byte 0x01, 0x00 # Value |
| 18 | +; ASM-NEXT: .asciz "Test1" # Name |
| 19 | + |
| 20 | +; ASM: .short {{.*-.*}} # Record length |
| 21 | +; ASM: .short 4359 # Record kind: S_CONSTANT |
| 22 | +; ASM: .long 4099 # Type |
| 23 | +; ASM: .byte 0x02, 0x00 # Value |
| 24 | +; ASM: .asciz "Foo::Test2" # Name |
18 | 25 |
|
19 | 26 | ; OBJ: CodeViewDebugInfo [
|
20 | 27 | ; OBJ: Section: .debug$S
|
|
27 | 34 | ; OBJ-NEXT: Value: 1
|
28 | 35 | ; OBJ-NEXT: Name: Test1
|
29 | 36 | ; OBJ-NEXT: }
|
| 37 | +; OBJ: ConstantSym { |
| 38 | +; OBJ-NEXT: Kind: S_CONSTANT (0x1107) |
| 39 | +; OBJ-NEXT: Type: const int (0x1003) |
| 40 | +; OBJ-NEXT: Value: 2 |
| 41 | +; OBJ-NEXT: Name: Foo::Test2 |
| 42 | +; OBJ-NEXT: } |
30 | 43 |
|
31 | 44 | ; ModuleID = 't.cpp'
|
32 | 45 | source_filename = "t.cpp"
|
33 | 46 | target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
|
34 | 47 | target triple = "x86_64-pc-windows-msvc"
|
35 | 48 |
|
36 | 49 | ; Function Attrs: noinline norecurse nounwind optnone
|
37 |
| -define dso_local i32 @main() #0 !dbg !13 { |
| 50 | +define dso_local i32 @main() #0 !dbg !19 { |
38 | 51 | entry:
|
39 | 52 | %retval = alloca i32, align 4
|
40 | 53 | store i32 0, i32* %retval, align 4
|
41 |
| - ret i32 1, !dbg !16 |
| 54 | + ret i32 3, !dbg !22 |
42 | 55 | }
|
43 | 56 |
|
| 57 | +attributes #0 = { noinline norecurse nounwind optnone "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-math"="false" "no-signed-zeros-fp-math"="false" "no-trapping-math"="false" "stack-protector-buffer-size"="8" "target-features"="+cx8,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" } |
| 58 | + |
44 | 59 | !llvm.dbg.cu = !{!0}
|
45 |
| -!llvm.module.flags = !{!9, !10, !11} |
46 |
| -!llvm.ident = !{!12} |
| 60 | +!llvm.module.flags = !{!15, !16, !17} |
| 61 | +!llvm.ident = !{!18} |
47 | 62 |
|
48 |
| -!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 9.0.0 (https://github.com/llvm/llvm-project.git 4a1902b6739e3087a03c0ac7ab85b640764e9335)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, globals: !3, nameTableKind: None) |
49 |
| -!1 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Ctest", checksumkind: CSK_MD5, checksum: "0d5ef00bdd80bdb409a3deac9938f20d") |
| 63 | +!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 9.0.0 (https://github.com/llvm/llvm-project.git 2b66a49044196d8b90d95d7d3b5246ccbe3abc05)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, retainedTypes: !3, globals: !10, nameTableKind: None) |
| 64 | +!1 = !DIFile(filename: "<stdin>", directory: "C:\5Csrc\5Ctest", checksumkind: CSK_MD5, checksum: "77cff5e1c7b260440ed03b23c18809c3") |
50 | 65 | !2 = !{}
|
51 | 66 | !3 = !{!4}
|
52 |
| -!4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value)) |
53 |
| -!5 = distinct !DIGlobalVariable(name: "Test1", scope: !0, file: !6, line: 1, type: !7, isLocal: true, isDefinition: true) |
54 |
| -!6 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Ctest", checksumkind: CSK_MD5, checksum: "0d5ef00bdd80bdb409a3deac9938f20d") |
55 |
| -!7 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8) |
56 |
| -!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
57 |
| -!9 = !{i32 2, !"CodeView", i32 1} |
58 |
| -!10 = !{i32 2, !"Debug Info Version", i32 3} |
59 |
| -!11 = !{i32 1, !"wchar_size", i32 2} |
60 |
| -!12 = !{!"clang version 9.0.0 (https://github.com/llvm/llvm-project.git 4a1902b6739e3087a03c0ac7ab85b640764e9335)"} |
61 |
| -!13 = distinct !DISubprogram(name: "main", scope: !6, file: !6, line: 3, type: !14, scopeLine: 3, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) |
62 |
| -!14 = !DISubroutineType(types: !15) |
63 |
| -!15 = !{!8} |
64 |
| -!16 = !DILocation(line: 4, scope: !13) |
| 67 | +!4 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", file: !5, line: 3, size: 8, flags: DIFlagTypePassByValue, elements: !6, identifier: ".?AUFoo@@") |
| 68 | +!5 = !DIFile(filename: "t.cpp", directory: "C:\5Csrc\5Ctest", checksumkind: CSK_MD5, checksum: "77cff5e1c7b260440ed03b23c18809c3") |
| 69 | +!6 = !{!7} |
| 70 | +!7 = !DIDerivedType(tag: DW_TAG_member, name: "Test2", scope: !4, file: !5, line: 4, baseType: !8, flags: DIFlagStaticMember, extraData: i32 2) |
| 71 | +!8 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !9) |
| 72 | +!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) |
| 73 | +!10 = !{!11, !13} |
| 74 | +!11 = !DIGlobalVariableExpression(var: !12, expr: !DIExpression(DW_OP_constu, 1, DW_OP_stack_value)) |
| 75 | +!12 = distinct !DIGlobalVariable(name: "Test1", scope: null, file: !5, line: 1, type: !8, isLocal: true, isDefinition: true) |
| 76 | +!13 = !DIGlobalVariableExpression(var: !14, expr: !DIExpression(DW_OP_constu, 2, DW_OP_stack_value)) |
| 77 | +!14 = distinct !DIGlobalVariable(name: "Test2", scope: !0, file: !5, line: 4, type: !8, isLocal: true, isDefinition: true, declaration: !7) |
| 78 | +!15 = !{i32 2, !"CodeView", i32 1} |
| 79 | +!16 = !{i32 2, !"Debug Info Version", i32 3} |
| 80 | +!17 = !{i32 1, !"wchar_size", i32 2} |
| 81 | +!18 = !{!"clang version 9.0.0 (https://github.com/llvm/llvm-project.git 2b66a49044196d8b90d95d7d3b5246ccbe3abc05)"} |
| 82 | +!19 = distinct !DISubprogram(name: "main", scope: !5, file: !5, line: 7, type: !20, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2) |
| 83 | +!20 = !DISubroutineType(types: !21) |
| 84 | +!21 = !{!9} |
| 85 | +!22 = !DILocation(line: 8, scope: !19) |
0 commit comments