2017-09-12 07:05:20 +08:00
; RUN: %llc_dwarf -O0 -filetype=obj < %s | llvm-dwarfdump -v - | FileCheck %s
2016-01-07 22:28:20 +08:00
2017-05-27 02:52:56 +08:00
; CHECK-LABEL: .debug_info contents:
; CHECK: DW_TAG_compile_unit
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}}"debug-macro.cpp")
; CHECK: DW_AT_macro_info {{.*}}(0x00000000)
; CHECK: DW_TAG_compile_unit
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}}"debug-macro1.cpp")
2019-11-09 04:56:49 +08:00
; CHECK: DW_AT_macro_info {{.*}}(0x00000045)
2017-05-27 02:52:56 +08:00
; CHECK: DW_TAG_compile_unit
; CHECK-NOT: DW_TAG
; CHECK: DW_AT_name {{.*}}"debug-macro2.cpp")
; CHECK-NOT: DW_AT_macro_info
2016-01-07 22:28:20 +08:00
2017-05-27 02:52:56 +08:00
; CHECK-LABEL: .debug_macinfo contents:
2020-03-03 11:30:03 +08:00
; CHECK-NEXT: 0x00000000:
2017-05-27 02:52:56 +08:00
; CHECK-NEXT: DW_MACINFO_define - lineno: 0 macro: NameCMD ValueCMD
; CHECK-NEXT: DW_MACINFO_start_file - lineno: 0 filenum: 1
; CHECK-NEXT: DW_MACINFO_start_file - lineno: 9 filenum: 2
; CHECK-NEXT: DW_MACINFO_define - lineno: 1 macro: NameDef Value
; CHECK-NEXT: DW_MACINFO_undef - lineno: 11 macro: NameUndef
; CHECK-NEXT: DW_MACINFO_end_file
; CHECK-NEXT: DW_MACINFO_undef - lineno: 10 macro: NameUndef2
; CHECK-NEXT: DW_MACINFO_end_file
2020-03-03 11:30:03 +08:00
; CHECK-EMPTY:
; CHECK-NEXT: 0x00000045:
; CHECK-NEXT: DW_MACINFO_start_file - lineno: 0 filenum: 1
2017-05-27 02:52:56 +08:00
; CHECK-NEXT: DW_MACINFO_end_file
2016-01-07 22:28:20 +08:00
2017-05-27 02:52:56 +08:00
; CHECK-LABEL: .debug_line contents:
2018-02-24 07:01:06 +08:00
; CHECK: file_names[ 1]:
; CHECK: name: "debug-macro.cpp"
; CHECK: file_names[ 2]:
; CHECK: name: "debug-macro.h"
; CHECK: file_names[ 1]:
; CHECK: name: "debug-macro1.cpp"
2016-01-07 22:28:20 +08:00
!llvm.dbg.cu = ! { !0 , !16 , !20 }
!llvm.module.flags = ! { !13 , !14 }
!llvm.ident = ! { !15 }
2016-04-15 23:57:41 +08:00
!0 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.5.0 " , isOptimized: false , emissionKind: F u l l D e b u g , file: !1 , enums: !2 , retainedTypes: !2 , globals: !2 , imports: !2 , macros: !3 )
2016-01-07 22:28:20 +08:00
!1 = !DIFile ( filename: "debug-macro.cpp" , directory: "/" )
!2 = ! { }
!3 = ! { !4 , !5 }
!4 = !DIMacro ( type: D W _ M A C I N F O _ define , line: 0 , name: "NameCMD" , value: "ValueCMD" )
!5 = !DIMacroFile ( line: 0 , file: !1 , nodes: !6 )
!6 = ! { !7 , !12 }
!7 = !DIMacroFile ( line: 9 , file: !8 , nodes: !9 )
!8 = !DIFile ( filename: "debug-macro.h" , directory: "/" )
!9 = ! { !10 , !11 }
!10 = !DIMacro ( type: D W _ M A C I N F O _ define , line: 1 , name: "NameDef" , value: "Value" )
!11 = !DIMacro ( type: D W _ M A C I N F O _ undef , line: 11 , name: "NameUndef" )
!12 = !DIMacro ( type: D W _ M A C I N F O _ undef , line: 10 , name: "NameUndef2" )
!13 = ! { i32 2 , !"Dwarf Version" , i32 4 }
!14 = ! { i32 1 , !"Debug Info Version" , i32 3 }
!15 = ! { !"clang version 3.5.0 " }
2017-05-27 02:52:56 +08:00
!16 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.5.0 " , isOptimized: false , emissionKind: F u l l D e b u g , file: !17 , enums: !2 , retainedTypes: !22 , globals: !2 , imports: !2 , macros: !18 )
2016-01-07 22:28:20 +08:00
!17 = !DIFile ( filename: "debug-macro1.cpp" , directory: "/" )
!18 = ! { !19 }
!19 = !DIMacroFile ( line: 0 , file: !17 , nodes: !2 )
2017-05-27 02:52:56 +08:00
!20 = distinct !DICompileUnit ( language: D W _ L A N G _ C _ p l u s _ p l u s , producer: "clang version 3.5.0 " , isOptimized: false , emissionKind: F u l l D e b u g , file: !21 , enums: !2 , retainedTypes: !24 , globals: !2 , imports: !2 )
2016-01-07 22:28:20 +08:00
!21 = !DIFile ( filename: "debug-macro2.cpp" , directory: "/" )
2017-05-27 02:52:56 +08:00
!22 = ! { !23 }
!23 = !DIBasicType ( name: "int" , size: 32 , encoding: D W _ A T E _ s i g n e d )
!24 = ! { !25 }
!25 = !DIBasicType ( name: "float" , size: 32 , encoding: D W _ A T E _ float )