DebugInfo: Remove some unneeded conditionals now that DIBuilder no longer emits zero...
[oota-llvm.git] / test / DebugInfo / X86 / generate-odr-hash.ll
index 8ff367fa675dd5c299018b6cbaf720607f8bc477..ca9f6e11d0abce10901ab77a829eef71bdef23e2 100644 (file)
@@ -1,7 +1,10 @@
 ; REQUIRES: object-emission
 
-; RUN: llc %s -o %t -filetype=obj -O0 -generate-type-units -generate-odr-hash -mtriple=x86_64-unknown-linux-gnu
-; RUN: llvm-dwarfdump %t | FileCheck %s
+; RUN: llc %s -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
+; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=SINGLE %s
+
+; RUN: llc %s -split-dwarf=Enable -o %t -filetype=obj -O0 -generate-type-units -mtriple=x86_64-unknown-linux-gnu
+; RUN: llvm-dwarfdump %t | FileCheck --check-prefix=CHECK --check-prefix=FISSION %s
 
 ; Generated from:
 ; struct bar {};
 
 ; wombat wom;
 
-; CHECK-LABEL: .debug_info contents:
+; SINGLE-LABEL: .debug_info contents:
+; FISSION-LABEL: .debug_info.dwo contents:
+; CHECK: Compile Unit: length = [[CU_SIZE:[0-9a-f]+]]
 
-; Check that we generate a hash for bar and the value.
-; CHECK-LABEL: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x200520c0d5b90eff)
 ; CHECK: DW_TAG_structure_type
-; CHECK-NEXT: debug_str{{.*}}"bar"
-
-; Check that we generate a hash for fluffy and the value.
-; CHECK-LABEL: DW_AT_GNU_odr_signature [DW_FORM_data8]   (0x9a0124d5a0c21c52)
-; CHECK: DW_TAG_namespace
-; CHECK-NEXT: debug_str{{.*}}"echidna"
-; CHECK: DW_TAG_namespace
-; CHECK-NEXT: debug_str{{.*}}"capybara"
-; CHECK: DW_TAG_namespace
-; CHECK-NEXT: debug_str{{.*}}"mongoose"
+; CHECK-NEXT: DW_AT_declaration
+; CHECK-NEXT: DW_AT_signature
 ; CHECK: DW_TAG_class_type
-; CHECK-NEXT: debug_str{{.*}}"fluffy"
+; CHECK-NEXT: DW_AT_declaration
+; CHECK-NEXT: DW_AT_signature
 
-; We emit no hash for walrus since the type is contained in an anonymous
-; namespace and won't violate any ODR-ness.
-; CHECK: DW_TAG_type_unit
-; CHECK-NOT: NULL
-; CHECK-NOT: DW_AT_GNU_odr_signature
+; Ensure the CU-local type 'walrus' is not placed in a type unit.
 ; CHECK: DW_TAG_structure_type
-; CHECK-NEXT: debug_str{{.*}}"walrus"
+; CHECK-NEXT: DW_AT_name{{.*}}"walrus"
 ; CHECK-NEXT: DW_AT_byte_size
 ; CHECK-NEXT: DW_AT_decl_file
 ; CHECK-NEXT: DW_AT_decl_line
-; CHECK: DW_TAG_subprogram
 
+; FISSION-LABEL: .debug_types contents:
+; FISSION-NOT: type_signature
+; FISSION-LABEL: type_signature = 0x1d02f3be30cc5688
+; FISSION: DW_TAG_type_unit
+; FISSION: DW_AT_GNU_dwo_name{{.*}}"bar.dwo"
+; FISSION: DW_AT_comp_dir{{.*}}"/tmp/dbginfo"
+; FISSION-NOT: type_signature
+; FISSION-LABEL: type_signature = 0xb04af47397402e77
+; FISSION-NOT: type_signature
+; FISSION-LABEL: type_signature = 0xfd756cee88f8a118
+; FISSION-NOT: type_signature
+; FISSION-LABEL: type_signature = 0xe94f6d3843e62d6b
+
+; SINGLE-LABEL: .debug_types contents:
+; FISSION-LABEL: .debug_types.dwo contents:
+
+; Check that we generate a hash for bar and the value.
+; CHECK-NOT: type_signature
+; CHECK-LABEL: type_signature = 0x1d02f3be30cc5688
+; CHECK: DW_TAG_structure_type
+; CHECK-NEXT: DW_AT_name{{.*}}"bar"
+
+
+; Check that we generate a hash for fluffy and the value.
+; CHECK-NOT: type_signature
+; CHECK-LABEL: type_signature = 0xb04af47397402e77
+; CHECK-NOT: DW_AT_GNU_odr_signature [DW_FORM_data8]   (0x9a0124d5a0c21c52)
+; CHECK: DW_TAG_namespace
+; CHECK-NEXT: DW_AT_name{{.*}}"echidna"
+; CHECK: DW_TAG_namespace
+; CHECK-NEXT: DW_AT_name{{.*}}"capybara"
+; CHECK: DW_TAG_namespace
+; CHECK-NEXT: DW_AT_name{{.*}}"mongoose"
+; CHECK: DW_TAG_class_type
+; CHECK-NEXT: DW_AT_name{{.*}}"fluffy"
 
 ; Check that we generate a hash for wombat and the value, but not for the
 ; anonymous type contained within.
+; CHECK-NOT: type_signature
+; CHECK-LABEL: type_signature = 0xfd756cee88f8a118
+; CHECK-NOT: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x685bcc220141e9d7)
+; CHECK: DW_TAG_structure_type
+; CHECK-NEXT: DW_AT_name{{.*}}"wombat"
+
+; CHECK-NOT: type_signature
+; CHECK-LABEL: type_signature = 0xe94f6d3843e62d6b
 ; CHECK: DW_TAG_type_unit
+; CHECK-NOT: NULL
+; CHECK-NOT: DW_AT_GNU_odr_signature
 ; CHECK: DW_TAG_structure_type
-; The signature for the outer 'wombat' type - this can be FileChecked once the
-; type units are moved to their own section with the full type unit header
-; including the signature
-; CHECK: DW_AT_signature [DW_FORM_ref_sig8] (0x73776f130648b986)
+; The signature for the outer 'wombat' type
+; CHECK: DW_AT_signature [DW_FORM_ref_sig8] (0xfd756cee88f8a118)
 ; CHECK: DW_TAG_structure_type
 ; CHECK-NOT: DW_AT_name
 ; CHECK-NOT: DW_AT_GNU_odr_signature
 ; CHECK: DW_TAG_member
-; CHECK-NEXT: debug_str{{.*}}"a"
-; CHECK-LABEL: DW_AT_GNU_odr_signature [DW_FORM_data8] (0x685bcc220141e9d7)
-; CHECK: DW_TAG_structure_type
-; CHECK-NEXT: debug_str{{.*}}"wombat"
+; CHECK-NEXT: DW_AT_name{{.*}}"a"
 
-; Don't emit pubtype entries for type DIEs in the compile unit that just indirect to a type unit.
+; Use the unit size as a rough hash/identifier for the unit we're dealing with
+; it happens to be unambiguous at the moment, but it's hardly ideal.
 ; CHECK-LABEL: .debug_pubtypes contents:
-; CHECK-NEXT: unit_offset = 0x00000000
-; CHECK-NEXT: Offset
-; CHECK-NEXT: {{^$}}
+; Don't emit pubtype entries for type DIEs in the compile unit that just indirect to a type unit.
+; CHECK-NEXT: unit_size = [[CU_SIZE]]
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "walrus"
+; Type unit for 'bar'
+; SINGLE-NEXT: unit_size = 0x00000023
+; FISSION-NEXT: unit_size = 0x00000024
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "bar"
+; SINGLE-NEXT: unit_size = 0x0000005d
+; FISSION-NEXT: unit_size = 0x00000024
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "int"
+; CHECK-NEXT: "echidna::capybara::mongoose::fluffy"
+; SINGLE-NEXT: unit_size = 0x0000003a
+; FISSION-NEXT: unit_size = 0x00000024
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "wombat"
+; SINGLE-NEXT: unit_size = 0x0000004b
+; FISSION-NEXT: unit_size = 0x00000024
+; CHECK-NEXT: Offset Name
+; CHECK-NEXT: "int"
 
 %struct.bar = type { i8 }
 %"class.echidna::capybara::mongoose::fluffy" = type { i32, i32 }
@@ -152,9 +203,9 @@ attributes #1 = { nounwind readnone }
 !llvm.module.flags = !{!42, !54}
 !llvm.ident = !{!43}
 
-!0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.4 ", i1 false, metadata !"", i32 0, metadata !2, metadata !3, metadata !20, metadata !37, metadata !2, metadata !""} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/bar.cpp] [DW_LANG_C_plus_plus]
+!0 = metadata !{i32 786449, metadata !1, i32 4, metadata !"clang version 3.4 ", i1 false, metadata !"", i32 0, metadata !2, metadata !3, metadata !20, metadata !37, metadata !2, metadata !"bar.dwo"} ; [ DW_TAG_compile_unit ] [/tmp/dbginfo/bar.cpp] [DW_LANG_C_plus_plus]
 !1 = metadata !{metadata !"bar.cpp", metadata !"/tmp/dbginfo"}
-!2 = metadata !{i32 0}
+!2 = metadata !{}
 !3 = metadata !{metadata !4, metadata !5, metadata !13, metadata !16}
 !4 = metadata !{i32 786451, metadata !1, null, metadata !"bar", i32 1, i64 8, i64 8, i32 0, i32 0, null, metadata !2, i32 0, null, null, metadata !"_ZTS3bar"} ; [ DW_TAG_structure_type ] [bar] [line 1, size 8, align 8, offset 0] [def] [from ]
 !5 = metadata !{i32 786434, metadata !1, metadata !6, metadata !"fluffy", i32 13, i64 64, i64 32, i32 0, i32 0, null, metadata !9, i32 0, null, null, metadata !"_ZTSN7echidna8capybara8mongoose6fluffyE"} ; [ DW_TAG_class_type ] [fluffy] [line 13, size 64, align 32, offset 0] [def] [from ]