2014-03-14 21:20:07 +00:00
|
|
|
; RUN: llc -split-dwarf=Enable -O0 %s -mtriple=x86_64-unknown-linux-gnu -filetype=obj -o %t
|
2013-01-25 21:44:53 +00:00
|
|
|
; RUN: llvm-dwarfdump -debug-dump=all %t | FileCheck %s
|
2013-04-07 03:43:09 +00:00
|
|
|
; RUN: llvm-readobj --relocations %t | FileCheck --check-prefix=OBJ %s
|
2014-02-25 22:46:44 +00:00
|
|
|
; RUN: llvm-objdump -h %t | FileCheck --check-prefix=HDR %s
|
2012-11-30 23:59:06 +00:00
|
|
|
|
|
|
|
@a = common global i32 0, align 4
|
|
|
|
|
|
|
|
!llvm.dbg.cu = !{!0}
|
2013-11-22 21:49:45 +00:00
|
|
|
!llvm.module.flags = !{!9}
|
2012-11-30 23:59:06 +00:00
|
|
|
|
2015-03-03 17:24:31 +00:00
|
|
|
!0 = !MDCompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)", isOptimized: false, splitDebugFilename: "baz.dwo", emissionKind: 0, file: !8, enums: !1, retainedTypes: !1, subprograms: !1, globals: !3, imports: !1)
|
IR: Make metadata typeless in assembly
Now that `Metadata` is typeless, reflect that in the assembly. These
are the matching assembly changes for the metadata/value split in
r223802.
- Only use the `metadata` type when referencing metadata from a call
intrinsic -- i.e., only when it's used as a `Value`.
- Stop pretending that `ValueAsMetadata` is wrapped in an `MDNode`
when referencing it from call intrinsics.
So, assembly like this:
define @foo(i32 %v) {
call void @llvm.foo(metadata !{i32 %v}, metadata !0)
call void @llvm.foo(metadata !{i32 7}, metadata !0)
call void @llvm.foo(metadata !1, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{metadata !3}, metadata !0)
ret void, !bar !2
}
!0 = metadata !{metadata !2}
!1 = metadata !{i32* @global}
!2 = metadata !{metadata !3}
!3 = metadata !{}
turns into this:
define @foo(i32 %v) {
call void @llvm.foo(metadata i32 %v, metadata !0)
call void @llvm.foo(metadata i32 7, metadata !0)
call void @llvm.foo(metadata i32* @global, metadata !0)
call void @llvm.foo(metadata !3, metadata !0)
call void @llvm.foo(metadata !{!3}, metadata !0)
ret void, !bar !2
}
!0 = !{!2}
!1 = !{i32* @global}
!2 = !{!3}
!3 = !{}
I wrote an upgrade script that handled almost all of the tests in llvm
and many of the tests in cfe (even handling many `CHECK` lines). I've
attached it (or will attach it in a moment if you're speedy) to PR21532
to help everyone update their out-of-tree testcases.
This is part of PR21532.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@224257 91177308-0d34-0410-b5e6-96231b3b80d8
2014-12-15 19:07:53 +00:00
|
|
|
!1 = !{}
|
|
|
|
!3 = !{!5}
|
2015-03-03 17:24:31 +00:00
|
|
|
!5 = !MDGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !6, type: !7, variable: i32* @a)
|
|
|
|
!6 = !MDFile(filename: "baz.c", directory: "/usr/local/google/home/echristo/tmp")
|
|
|
|
!7 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
|
|
|
|
!8 = !MDFile(filename: "baz.c", directory: "/usr/local/google/home/echristo/tmp")
|
2012-11-30 23:59:06 +00:00
|
|
|
|
|
|
|
; Check that the skeleton compile unit contains the proper attributes:
|
|
|
|
; This DIE has the following attributes: DW_AT_comp_dir, DW_AT_stmt_list,
|
|
|
|
; DW_AT_low_pc, DW_AT_high_pc, DW_AT_ranges, DW_AT_dwo_name, DW_AT_dwo_id,
|
|
|
|
; DW_AT_ranges_base, DW_AT_addr_base.
|
|
|
|
|
2013-02-05 07:32:00 +00:00
|
|
|
; CHECK: .debug_abbrev contents:
|
|
|
|
; CHECK: Abbrev table for offset: 0x00000000
|
|
|
|
; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_no
|
2014-01-09 04:28:46 +00:00
|
|
|
; CHECK: DW_AT_stmt_list DW_FORM_sec_offset
|
2013-02-05 07:32:00 +00:00
|
|
|
; CHECK: DW_AT_GNU_dwo_name DW_FORM_strp
|
|
|
|
; CHECK: DW_AT_comp_dir DW_FORM_strp
|
2013-08-12 20:27:48 +00:00
|
|
|
; CHECK: DW_AT_GNU_dwo_id DW_FORM_data8
|
2013-02-05 07:32:00 +00:00
|
|
|
|
2013-01-15 23:56:56 +00:00
|
|
|
; Check that we're using the right forms.
|
|
|
|
; CHECK: .debug_abbrev.dwo contents:
|
|
|
|
; CHECK: Abbrev table for offset: 0x00000000
|
|
|
|
; CHECK: [1] DW_TAG_compile_unit DW_CHILDREN_yes
|
|
|
|
; CHECK: DW_AT_producer DW_FORM_GNU_str_index
|
|
|
|
; CHECK: DW_AT_language DW_FORM_data2
|
|
|
|
; CHECK: DW_AT_name DW_FORM_GNU_str_index
|
2013-04-09 19:23:15 +00:00
|
|
|
; CHECK-NOT: DW_AT_low_pc
|
|
|
|
; CHECK-NOT: DW_AT_stmt_list
|
|
|
|
; CHECK-NOT: DW_AT_comp_dir
|
2013-02-05 07:31:55 +00:00
|
|
|
; CHECK: DW_AT_GNU_dwo_id DW_FORM_data8
|
2013-01-15 23:56:56 +00:00
|
|
|
|
2013-10-29 05:49:41 +00:00
|
|
|
; CHECK: [2] DW_TAG_variable DW_CHILDREN_no
|
2013-01-15 23:56:56 +00:00
|
|
|
; CHECK: DW_AT_name DW_FORM_GNU_str_index
|
|
|
|
; CHECK: DW_AT_type DW_FORM_ref4
|
|
|
|
; CHECK: DW_AT_external DW_FORM_flag_present
|
|
|
|
; CHECK: DW_AT_decl_file DW_FORM_data1
|
|
|
|
; CHECK: DW_AT_decl_line DW_FORM_data1
|
2014-02-16 08:46:55 +00:00
|
|
|
; CHECK: DW_AT_location DW_FORM_exprloc
|
2013-01-15 23:56:56 +00:00
|
|
|
|
2013-10-29 05:49:41 +00:00
|
|
|
; CHECK: [3] DW_TAG_base_type DW_CHILDREN_no
|
|
|
|
; CHECK: DW_AT_name DW_FORM_GNU_str_index
|
|
|
|
; CHECK: DW_AT_encoding DW_FORM_data1
|
|
|
|
; CHECK: DW_AT_byte_size DW_FORM_data1
|
|
|
|
|
2014-01-08 23:29:59 +00:00
|
|
|
; CHECK: .debug_info contents:
|
|
|
|
; CHECK: DW_TAG_compile_unit
|
2014-03-24 21:31:35 +00:00
|
|
|
; CHECK-NEXT: DW_AT_stmt_list [DW_FORM_sec_offset] (0x00000000)
|
|
|
|
; CHECK-NEXT: DW_AT_GNU_dwo_name [DW_FORM_strp] ( .debug_str[0x00000000] = "baz.dwo")
|
|
|
|
; CHECK-NEXT: DW_AT_comp_dir [DW_FORM_strp] ( .debug_str[0x00000008] = "/usr/local/google/home/echristo/tmp")
|
|
|
|
; CHECK-NEXT: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x1f1f859683d49324)
|
2014-01-08 23:29:59 +00:00
|
|
|
|
2013-01-02 23:52:13 +00:00
|
|
|
; Check that the rest of the compile units have information.
|
|
|
|
; CHECK: .debug_info.dwo contents:
|
|
|
|
; CHECK: DW_TAG_compile_unit
|
2013-01-07 19:32:41 +00:00
|
|
|
; CHECK: DW_AT_producer [DW_FORM_GNU_str_index] ( indexed (00000000) string = "clang version 3.3 (trunk 169021) (llvm/trunk 169020)")
|
2014-09-04 19:39:20 +00:00
|
|
|
; CHECK: DW_AT_language [DW_FORM_data2] (DW_LANG_C99)
|
2013-01-07 19:32:41 +00:00
|
|
|
; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000001) string = "baz.c")
|
2013-04-09 19:23:15 +00:00
|
|
|
; CHECK-NOT: DW_AT_low_pc
|
|
|
|
; CHECK-NOT: DW_AT_stmt_list
|
|
|
|
; CHECK-NOT: DW_AT_comp_dir
|
2014-02-20 02:50:45 +00:00
|
|
|
; CHECK: DW_AT_GNU_dwo_id [DW_FORM_data8] (0x1f1f859683d49324)
|
2013-01-02 23:52:13 +00:00
|
|
|
; CHECK: DW_TAG_variable
|
2013-04-09 19:23:15 +00:00
|
|
|
; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000002) string = "a")
|
2013-10-29 05:49:41 +00:00
|
|
|
; CHECK: DW_AT_type [DW_FORM_ref4] (cu + 0x{{[0-9a-f]*}} => {[[TYPE:0x[0-9a-f]*]]})
|
2013-01-18 22:11:33 +00:00
|
|
|
; CHECK: DW_AT_external [DW_FORM_flag_present] (true)
|
|
|
|
; CHECK: DW_AT_decl_file [DW_FORM_data1] (0x01)
|
2014-09-05 07:21:50 +00:00
|
|
|
; CHECK: DW_AT_decl_line [DW_FORM_data1] (1)
|
2014-02-16 08:46:55 +00:00
|
|
|
; CHECK: DW_AT_location [DW_FORM_exprloc] (<0x2> fb 00 )
|
2013-10-29 05:49:41 +00:00
|
|
|
; CHECK: [[TYPE]]: DW_TAG_base_type
|
|
|
|
; CHECK: DW_AT_name [DW_FORM_GNU_str_index] ( indexed (00000003) string = "int")
|
2013-01-18 22:11:33 +00:00
|
|
|
|
2014-01-08 23:29:59 +00:00
|
|
|
; CHECK: .debug_str contents:
|
|
|
|
; CHECK: 0x00000000: "baz.dwo"
|
|
|
|
; CHECK: 0x00000008: "/usr/local/google/home/echristo/tmp"
|
2013-01-15 23:56:56 +00:00
|
|
|
|
|
|
|
; CHECK: .debug_str.dwo contents:
|
|
|
|
; CHECK: 0x00000000: "clang version 3.3 (trunk 169021) (llvm/trunk 169020)"
|
|
|
|
; CHECK: 0x00000035: "baz.c"
|
2013-04-09 19:23:15 +00:00
|
|
|
; CHECK: 0x0000003b: "a"
|
|
|
|
; CHECK: 0x0000003d: "int"
|
2013-01-15 23:56:56 +00:00
|
|
|
|
|
|
|
; CHECK: .debug_str_offsets.dwo contents:
|
|
|
|
; CHECK: 0x00000000: 00000000
|
|
|
|
; CHECK: 0x00000004: 00000035
|
|
|
|
; CHECK: 0x00000008: 0000003b
|
2013-04-09 19:23:15 +00:00
|
|
|
; CHECK: 0x0000000c: 0000003d
|
2013-04-07 03:43:09 +00:00
|
|
|
|
|
|
|
; Object file checks
|
|
|
|
; For x86-64-linux we should have this set of relocations for the debug info section
|
|
|
|
;
|
|
|
|
; OBJ: .debug_info
|
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_abbrev
|
2014-01-09 04:28:46 +00:00
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_line
|
2013-04-07 03:43:09 +00:00
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_str
|
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_str
|
2014-03-21 20:27:21 +00:00
|
|
|
; OBJ-NEXT: R_X86_64_32 .debug_addr
|
2013-04-07 03:43:09 +00:00
|
|
|
; OBJ-NEXT: }
|
2013-12-30 17:22:27 +00:00
|
|
|
|
2014-02-25 22:46:44 +00:00
|
|
|
; HDR-NOT: .debug_aranges
|
2014-03-24 20:53:02 +00:00
|
|
|
; HDR-NOT: .rela.{{.*}}.dwo
|
2014-02-25 22:46:44 +00:00
|
|
|
|
2015-03-03 17:24:31 +00:00
|
|
|
!9 = !{i32 1, !"Debug Info Version", i32 3}
|