1 Test binaries created with the following commands:
7 struct Container_ivars {
8 // real definition here
11 ContainerPtr allocateContainer() {
12 Container *c = (Container *)malloc(sizeof(Container));
13 c->ivars = (Container_ivars *)malloc(sizeof(Container_ivars));
17 extern void doSomething(ContainerPtr);
20 ContainerPtr c = allocateContainer();
26 struct Container_ivars;
30 struct Container_ivars *ivars;
34 typedef Container *ContainerPtr;
37 #include "container.h"
39 void doSomething(ContainerPtr c) {}
42 $ clang++ -O0 -g container.cpp -c -o container.o
43 $ clang++ -O0 -g use.cpp -c -o use.o
44 $ clang++ use.o container.o -o a.out
46 Note that the link order in the last command matters for this test.
48 RUN: dsymutil --linker llvm -oso-prepend-path %p/../Inputs %p/../Inputs/private/tmp/union/a.out -o %t.dSYM
49 RUN: llvm-dwarfdump --debug-info %t.dSYM | FileCheck %s
51 CHECK: DW_TAG_compile_unit
52 CHECK-NEXT: DW_AT_producer ("llvm DWARFLinkerParallel library
53 CHECK-NEXT: DW_AT_language (DW_LANG_C_plus_plus_14)
54 CHECK-NEXT: DW_AT_name ("__artificial_type_unit")
55 CHECK-NEXT: DW_AT_stmt_list (0x00000000)
57 CHECK: DW_TAG_structure_type
58 CHECK: DW_AT_calling_convention (DW_CC_pass_by_value)
59 CHECK: DW_AT_name ("Container_ivars")
60 CHECK-NEXT: DW_AT_byte_size (0x01)
61 CHECK-NEXT: DW_AT_decl_line (4)
62 CHECK-NEXT: DW_AT_decl_file ("{{.*}}container.cpp")
64 CHECK: DW_TAG_compile_unit
65 CHECK-NOT: DW_AT_declaration