xref: /llvm-project/llvm/test/DebugInfo/X86/debug-info-template-align.ll (revision 5a288fa32e0c91b211e39f3e370255916902f898)
1; RUN: llc %s -filetype=obj -o - | llvm-dwarfdump -v - | FileCheck %s
2
3; C++ source to regenerate:
4
5;typedef char  __attribute__((__aligned__(64))) alchar;
6
7;int main(){
8;    alchar newChar;
9;}
10; $ clang++ -O0 -g -gdwarf-5 debug-info-template-align.cpp -c
11
12; CHECK: .debug_abbrev contents:
13
14; CHECK: [5] DW_TAG_typedef  DW_CHILDREN_no
15; CHECK:  DW_AT_alignment DW_FORM_udata
16
17; CHECK: .debug_info contents:
18
19;CHECK: DW_TAG_typedef [5]
20;CHECK: DW_AT_name {{.*}} "alchar"
21;CHECK-NEXT: DW_AT_alignment [DW_FORM_udata] (64)
22
23
24; ModuleID = '/dir/test.cpp'
25source_filename = "/dir/test.cpp"
26target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
27target triple = "x86_64-unknown-linux-gnu"
28
29; Function Attrs: noinline norecurse nounwind optnone uwtable
30define dso_local i32 @main() #0 !dbg !7 {
31entry:
32  %newChar = alloca i8, align 64
33  call void @llvm.dbg.declare(metadata ptr %newChar, metadata !12, metadata !DIExpression()), !dbg !15
34  ret i32 0, !dbg !16
35}
36
37; Function Attrs: nounwind readnone speculatable willreturn
38declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
39
40attributes #0 = { noinline norecurse nounwind optnone uwtable }
41attributes #1 = { nounwind readnone speculatable willreturn }
42
43!llvm.dbg.cu = !{!0}
44!llvm.module.flags = !{!3, !4, !5}
45!llvm.ident = !{!6}
46
47!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 10.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
48!1 = !DIFile(filename: "/dir/test.cpp", directory: "/dir/", checksumkind: CSK_MD5, checksum: "872e252efdfcb9480b4bfaf8437f58ab")
49!2 = !{}
50!3 = !{i32 2, !"Dwarf Version", i32 5}
51!4 = !{i32 2, !"Debug Info Version", i32 3}
52!5 = !{i32 1, !"wchar_size", i32 4}
53!6 = !{!"clang version 10.0.0 "}
54!7 = distinct !DISubprogram(name: "main", scope: !8, file: !8, line: 12, type: !9, scopeLine: 12, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
55!8 = !DIFile(filename: "test.cpp", directory: "/dir", checksumkind: CSK_MD5, checksum: "872e252efdfcb9480b4bfaf8437f58ab")
56!9 = !DISubroutineType(types: !10)
57!10 = !{!11}
58!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
59!12 = !DILocalVariable(name: "newChar", scope: !7, file: !8, line: 13, type: !13)
60!13 = !DIDerivedType(tag: DW_TAG_typedef, name: "alchar", file: !8, line: 10, baseType: !14, align: 512)
61!14 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char)
62!15 = !DILocation(line: 13, column: 10, scope: !7)
63!16 = !DILocation(line: 14, column: 1, scope: !7)
64