1 ; RUN: llc -o - %s | FileCheck --check-prefix=CHECK-DWARF2 %s
2 ; RUN: llc -dwarf-version=4 -o - %s | FileCheck --check-prefix=CHECK-DWARF4 %s
4 ; Exercise DW_OP_stack_value on global constants.
6 target datalayout = "e-p:64:64"
7 target triple = "x86_64-unknown-linux-gnu"
9 ; CHECK-DWARF2: .byte 6 # DW_AT_location
10 ; CHECK-DWARF2-NEXT: .byte 52
11 ; CHECK-DWARF2-NEXT: .byte 147
12 ; CHECK-DWARF2-NEXT: .byte 2
13 ; CHECK-DWARF2-NEXT: .byte 48
14 ; CHECK-DWARF2-NEXT: .byte 147
15 ; CHECK-DWARF2-NEXT: .byte 2
16 ; CHECK-DWARF2: .byte 8 # DW_AT_location
17 ; CHECK-DWARF2-NEXT: .byte 17
18 ; CHECK-DWARF2-NEXT: .byte 127
19 ; CHECK-DWARF2-NEXT: .byte 147
20 ; CHECK-DWARF2-NEXT: .byte 2
21 ; CHECK-DWARF2-NEXT: .byte 17
22 ; CHECK-DWARF2-NEXT: .byte 126
23 ; CHECK-DWARF2-NEXT: .byte 147
24 ; CHECK-DWARF2-NEXT: .byte 2
25 ; CHECK-DWARF2-NEXT: .byte 0 # End Of Children Mark
27 ; CHECK-DWARF4: .byte 8 # DW_AT_location
28 ; CHECK-DWARF4-NEXT:.byte 52
29 ; CHECK-DWARF4-NEXT:.byte 159
30 ; CHECK-DWARF4-NEXT:.byte 147
31 ; CHECK-DWARF4-NEXT:.byte 2
32 ; CHECK-DWARF4-NEXT:.byte 48
33 ; CHECK-DWARF4-NEXT:.byte 159
34 ; CHECK-DWARF4-NEXT:.byte 147
35 ; CHECK-DWARF4-NEXT:.byte 2
36 ; CHECK-DWARF4: .byte 10 # DW_AT_location
37 ; CHECK-DWARF4-NEXT: .byte 17
38 ; CHECK-DWARF4-NEXT: .byte 127
39 ; CHECK-DWARF4-NEXT: .byte 159
40 ; CHECK-DWARF4-NEXT: .byte 147
41 ; CHECK-DWARF4-NEXT: .byte 2
42 ; CHECK-DWARF4-NEXT: .byte 17
43 ; CHECK-DWARF4-NEXT: .byte 126
44 ; CHECK-DWARF4-NEXT: .byte 159
45 ; CHECK-DWARF4-NEXT: .byte 147
46 ; CHECK-DWARF4-NEXT: .byte 2
47 ; CHECK-DWARF4-NEXT: .byte 0 # End Of Children Mark
49 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang", file: !4, globals: !1, emissionKind: FullDebug)
50 !1 = !{!2, !10, !11, !14}
51 !2 = !DIGlobalVariableExpression(var: !8, expr: !3)
52 !3 = !DIExpression(DW_OP_constu, 4, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 16)
53 !4 = !DIFile(filename: "<stdin>", directory: "/")
54 !5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
55 !6 = !{i32 2, !"Dwarf Version", i32 2}
56 !7 = !{i32 2, !"Debug Info Version", i32 3}
57 !8 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true, type: !5)
58 !9 = !DIExpression(DW_OP_constu, 0, DW_OP_stack_value, DW_OP_LLVM_fragment, 16, 16)
59 !10 = !DIGlobalVariableExpression(var: !8, expr: !9)
60 !11 = !DIGlobalVariableExpression(var: !13, expr: !12)
61 !12 = !DIExpression(DW_OP_consts, 18446744073709551615, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 16)
62 !13 = distinct !DIGlobalVariable(name: "b", scope: null, isLocal: false, isDefinition: true, type: !5)
63 !14 = !DIGlobalVariableExpression(var: !13, expr: !15)
64 !15 = !DIExpression(DW_OP_consts, 18446744073709551614, DW_OP_stack_value, DW_OP_LLVM_fragment, 16, 16)
67 !llvm.module.flags = !{!6, !7}