2016-12-20 03:09:43 +01:00
|
|
|
; RUN: llvm-dis -o - %s.bc | FileCheck %s
|
2017-01-03 20:17:49 +01:00
|
|
|
; RUN: llvm-dis -o - %s.bc | llvm-as - | llvm-bcanalyzer -dump - | FileCheck %s --check-prefix=BC
|
2016-12-20 03:09:43 +01:00
|
|
|
|
2017-01-03 20:17:49 +01:00
|
|
|
; BC: GLOBAL_VAR_EXPR
|
|
|
|
; BC: GLOBAL_DECL_ATTACHMENT
|
2016-12-20 03:09:43 +01:00
|
|
|
; CHECK: @g = common global i32 0, align 4, !dbg ![[G:[0-9]+]]
|
|
|
|
; CHECK: @h = common global i32 0, align 4, !dbg ![[H:[0-9]+]]
|
2017-08-23 22:31:27 +02:00
|
|
|
; CHECK: ![[G]] = {{.*}}!DIGlobalVariableExpression(var: ![[GVAR:[0-9]+]], expr: !DIExpression(DW_OP_plus_uconst, 1))
|
2016-12-20 03:09:43 +01:00
|
|
|
; CHECK: ![[GVAR]] = distinct !DIGlobalVariable(name: "g",
|
2017-02-07 18:35:41 +01:00
|
|
|
; CHECK: DICompileUnit({{.*}}, imports: ![[IMPORTS:[0-9]+]]
|
2017-08-23 22:31:27 +02:00
|
|
|
; CHECK: !DIGlobalVariableExpression(var: ![[CVAR:[0-9]+]], expr: !DIExpression(DW_OP_constu, 23, DW_OP_stack_value))
|
2016-12-20 03:09:43 +01:00
|
|
|
; CHECK: ![[CVAR]] = distinct !DIGlobalVariable(name: "c",
|
2017-02-07 18:35:41 +01:00
|
|
|
; CHECK: ![[HVAR:[0-9]+]] = distinct !DIGlobalVariable(name: "h",
|
|
|
|
; CHECK: ![[IMPORTS]] = !{![[CIMPORT:[0-9]+]]}
|
|
|
|
; CHECK: ![[CIMPORT]] = !DIImportedEntity({{.*}}entity: ![[HVAR]]
|
2017-08-30 20:06:51 +02:00
|
|
|
; CHECK: ![[H]] = {{.*}}!DIGlobalVariableExpression(var: ![[HVAR]], expr: !DIExpression())
|
2017-02-07 18:35:41 +01:00
|
|
|
|
2016-12-20 03:09:43 +01:00
|
|
|
@g = common global i32 0, align 4, !dbg !0
|
|
|
|
@h = common global i32 0, align 4, !dbg !11
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!1}
|
|
|
|
!llvm.module.flags = !{!6, !7, !8}
|
|
|
|
!llvm.ident = !{!9}
|
|
|
|
|
|
|
|
!0 = distinct !DIGlobalVariable(name: "g", scope: !1, file: !2, line: 1, type: !5, isLocal: false, isDefinition: true, expr: !DIExpression(DW_OP_plus, 1))
|
2017-02-07 18:35:41 +01:00
|
|
|
!1 = distinct !DICompileUnit(language: DW_LANG_C99, file: !2, producer: "clang version 4.0.0 (trunk 286129) (llvm/trunk 286128)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, imports: !3)
|
2016-12-20 03:09:43 +01:00
|
|
|
!2 = !DIFile(filename: "a.c", directory: "/")
|
2017-02-07 18:35:41 +01:00
|
|
|
!3 = !{!12}
|
2016-12-20 03:09:43 +01:00
|
|
|
!4 = !{!0, !10, !11}
|
|
|
|
!5 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
|
|
|
|
!6 = !{i32 2, !"Dwarf Version", i32 4}
|
|
|
|
!7 = !{i32 2, !"Debug Info Version", i32 3}
|
|
|
|
!8 = !{i32 1, !"PIC Level", i32 2}
|
|
|
|
!9 = !{!"clang version 4.0.0 (trunk 286129) (llvm/trunk 286128)"}
|
|
|
|
!10 = distinct !DIGlobalVariable(name: "c", scope: !1, file: !2, line: 1, type: !5, isLocal: false, isDefinition: true, expr: !DIExpression(DW_OP_constu, 23, DW_OP_stack_value))
|
|
|
|
!11 = distinct !DIGlobalVariable(name: "h", scope: !1, file: !2, line: 2, type: !5, isLocal: false, isDefinition: true)
|
2017-07-19 02:09:54 +02:00
|
|
|
!12 = !DIImportedEntity(tag: DW_TAG_imported_declaration, file: !2, line: 1, scope: !1, entity: !11)
|