101 lines · plain
1; RUN: llc -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s --implicit-check-not=DW_TAG2 3; typedef struct __attribute__((aligned (128))) {4; char c;5; } S0;6;7; typedef struct {8; __attribute__((aligned (64))) char c;9; } S1;10;11; S0 s0;12;13; void f() {14; S1 s1;15; __attribute__((aligned (32))) int i;16; }17 18; CHECK: DW_TAG_compile_unit19; CHECK: DW_TAG_variable20; CHECK: DW_TAG_typedef21; CHECK: DW_AT_name{{.*}}"S0"22 23; CHECK: DW_TAG_structure_type24; CHECK: DW_AT_alignment{{.*}}12825; CHECK: DW_TAG_member26; CHECK: DW_TAG_base_type27 28; CHECK: DW_TAG_subprogram29; CHECK: DW_TAG_variable30; CHECK: DW_TAG_variable31; CHECK: DW_AT_name{{.*}}"i"32; CHECK: DW_AT_alignment{{.*}}3233 34; CHECK: DW_TAG_typedef35; CHECK: DW_AT_name{{.*}}"S1"36; CHECK: DW_TAG_structure_type37; CHECK: DW_TAG_member38; CHECK: DW_AT_name{{.*}}"c"39; CHECK: DW_AT_alignment{{.*}}6440; CHECK: DW_TAG_base_type41 42; ModuleID = 'test.m'43source_filename = "test.m"44target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"45target triple = "x86_64-unknown-linux-gnu"46 47%struct.S0 = type { i8, [127 x i8] }48%struct.S1 = type { i8, [63 x i8] }49 50@s0 = common global %struct.S0 zeroinitializer, align 128, !dbg !051 52; Function Attrs: nounwind uwtable53define void @f() #0 !dbg !14 {54entry:55 %s1 = alloca %struct.S1, align 6456 %i = alloca i32, align 3257 call void @llvm.dbg.declare(metadata ptr %s1, metadata !17, metadata !22), !dbg !2358 call void @llvm.dbg.declare(metadata ptr %i, metadata !24, metadata !22), !dbg !2659 ret void, !dbg !2760}61 62; Function Attrs: nounwind readnone63declare void @llvm.dbg.declare(metadata, metadata, metadata) #164 65attributes #0 = { nounwind uwtable }66attributes #1 = { nounwind readnone }67 68!llvm.dbg.cu = !{!2}69!llvm.module.flags = !{!11, !12}70!llvm.ident = !{!13}71 72!0 = distinct !DIGlobalVariableExpression(var: !1, expr: !DIExpression())73!1 = !DIGlobalVariable(name: "s0", scope: !2, file: !3, line: 10, type: !6, isLocal: false, isDefinition: true)74!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)75!3 = !DIFile(filename: "test.m", directory: "/tmp")76!4 = !{}77!5 = !{!0}78!6 = !DIDerivedType(tag: DW_TAG_typedef, name: "S0", file: !3, line: 3, baseType: !7)79!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 1, size: 1024, align: 1024, elements: !8)80!8 = !{!9}81!9 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !7, file: !3, line: 2, baseType: !10, size: 8)82!10 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)83!11 = !{i32 2, !"Dwarf Version", i32 4}84!12 = !{i32 2, !"Debug Info Version", i32 3}85!13 = !{!"clang version 4.0.0"}86!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)87!15 = !DISubroutineType(types: !16)88!16 = !{null}89!17 = !DILocalVariable(name: "s1", scope: !14, file: !3, line: 13, type: !18)90!18 = !DIDerivedType(tag: DW_TAG_typedef, name: "S1", file: !3, line: 8, baseType: !19)91!19 = distinct !DICompositeType(tag: DW_TAG_structure_type, file: !3, line: 6, size: 512, elements: !20)92!20 = !{!21}93!21 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !19, file: !3, line: 7, baseType: !10, size: 8, align: 512)94!22 = !DIExpression()95!23 = !DILocation(line: 13, column: 6, scope: !14)96!24 = !DILocalVariable(name: "i", scope: !14, file: !3, line: 14, type: !25, align: 256)97!25 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)98!26 = !DILocation(line: 14, column: 37, scope: !14)99!27 = !DILocation(line: 15, column: 1, scope: !14)100 101