1 ; RUN: %llc_dwarf -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
2 ; REQUIRES: object-emission
4 ; typedef struct __attribute__((aligned (128))) {
9 ; __attribute__((aligned (64))) char c;
16 ; __attribute__((aligned (32))) int i;
19 ; CHECK: DW_TAG_typedef
21 ; CHECK: DW_AT_name{{.*}}"S0"
22 ; CHECK: DW_TAG_structure_type
24 ; CHECK: DW_AT_alignment{{.*}}128
26 ; CHECK: DW_TAG_variable
27 ; CHECK: DW_AT_name{{.*}}"i"
29 ; CHECK: DW_AT_alignment{{.*}}32
31 ; CHECK: DW_TAG_typedef
33 ; CHECK: DW_AT_name{{.*}}"S1"
34 ; CHECK: DW_TAG_structure_type
35 ; CHECK: DW_TAG_member
37 ; CHECK: DW_AT_name{{.*}}"c"
39 ; CHECK: DW_AT_alignment{{.*}}64
42 source_filename = "test.m"
43 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
44 target triple = "x86_64-unknown-linux-gnu"
46 %struct.S0 = type { i8, [127 x i8] }
47 %struct.S1 = type { i8, [63 x i8] }
49 @s0 = common global %struct.S0 zeroinitializer, align 128, !dbg !0
51 ; Function Attrs: nounwind uwtable
52 define void @f() #0 !dbg !14 {
54 %s1 = alloca %struct.S1, align 64
55 %i = alloca i32, align 32
56 call void @llvm.dbg.declare(metadata %struct.S1* %s1, metadata !17, metadata !22), !dbg !23
57 call void @llvm.dbg.declare(metadata i32* %i, metadata !24, metadata !22), !dbg !26
61 ; Function Attrs: nounwind readnone
62 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
64 attributes #0 = { nounwind uwtable }
65 attributes #1 = { nounwind readnone }
68 !llvm.module.flags = !{!11, !12}
71 !0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
72 !1 = !DIGlobalVariable(name: "s0", scope: !2, file: !3, line: 10, type: !6, isLocal: false, isDefinition: true)
73 !2 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !3, producer: "clang version 4.0.0", isOptimized: false, runtimeVersion: 1, emissionKind: FullDebug, enums: !4, globals: !5)
74 !3 = !DIFile(filename: "test.m", directory: "/tmp")
77 !6 = !DIDerivedType(tag: DW_TAG_typedef, name: "S0", file: !3, line: 3, baseType: !7)
78 !7 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 1, size: 1024, align: 1024, elements: !8)
80 !9 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !7, file: !3, line: 2, baseType: !10, size: 8)
81 !10 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
82 !11 = !{i32 2, !"Dwarf Version", i32 4}
83 !12 = !{i32 2, !"Debug Info Version", i32 3}
84 !13 = !{!"clang version 4.0.0"}
85 !14 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 12, type: !15, isLocal: false, isDefinition: true, scopeLine: 12, isOptimized: false, unit: !2, retainedNodes: !4)
86 !15 = !DISubroutineType(types: !16)
88 !17 = !DILocalVariable(name: "s1", scope: !14, file: !3, line: 13, type: !18)
89 !18 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", file: !3, line: 8, baseType: !19)
90 !19 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 6, size: 512, elements: !20)
92 !21 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !19, file: !3, line: 7, baseType: !10, size: 8, align: 512)
94 !23 = !DILocation(line: 13, column: 6, scope: !14)
95 !24 = !DILocalVariable(name: "i", scope: !14, file: !3, line: 14, type: !25, align: 256)
96 !25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
97 !26 = !DILocation(line: 14, column: 37, scope: !14)
98 !27 = !DILocation(line: 15, column: 1, scope: !14)