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 3 4; Exercise DW_OP_stack_value on global constants. 5 6target datalayout = "e-p:64:64" 7target triple = "x86_64-unknown-linux-gnu" 8 9; CHECK-DWARF2: .byte 8 # DW_AT_location 10; CHECK-DWARF2 .byte 16 11; CHECK-DWARF2 .byte 4 12; CHECK-DWARF2 .byte 147 13; CHECK-DWARF2 .byte 2 14; CHECK-DWARF2 .byte 16 15; CHECK-DWARF2 .byte 0 16; CHECK-DWARF2 .byte 147 17; CHECK-DWARF2 .byte 2 18 19; CHECK-DWARF4: .byte 10 # DW_AT_location 20; CHECK-DWARF4-NEXT: .byte 16 21; CHECK-DWARF4-NEXT: .byte 4 22; CHECK-DWARF4-NEXT: .byte 159 23; CHECK-DWARF4-NEXT: .byte 147 24; CHECK-DWARF4-NEXT: .byte 2 25; CHECK-DWARF4-NEXT: .byte 16 26; CHECK-DWARF4-NEXT: .byte 0 27; CHECK-DWARF4-NEXT: .byte 159 28 29!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang", file: !4, globals: !1, emissionKind: FullDebug) 30!1 = !{!2, !10} 31!2 = !DIGlobalVariableExpression(var: !8, expr: !3) 32!3 = !DIExpression(DW_OP_constu, 4, DW_OP_stack_value, DW_OP_LLVM_fragment, 0, 16) 33!4 = !DIFile(filename: "<stdin>", directory: "/") 34!5 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 35!6 = !{i32 2, !"Dwarf Version", i32 2} 36!7 = !{i32 2, !"Debug Info Version", i32 3} 37!8 = distinct !DIGlobalVariable(name: "a", scope: null, isLocal: false, isDefinition: true, type: !5) 38!9 = !DIExpression(DW_OP_constu, 0, DW_OP_stack_value, DW_OP_LLVM_fragment, 16, 16) 39!10 = !DIGlobalVariableExpression(var: !8, expr: !9) 40 41!llvm.dbg.cu = !{!0} 42!llvm.module.flags = !{!6, !7} 43