xref: /llvm-project/llvm/test/DebugInfo/X86/prototyped.ll (revision 4790b7433215daa3719e84c8bcb7f0029d203711)
1; RUN: rm -rf %t
2; RUN: mkdir %t
3
4; RUN: llc -mtriple x86_64-unknown-linux-gnu -O0 -filetype=obj -o %t.o %s
5; RUN: llvm-dwarfdump -debug-info %t.o | FileCheck %s
6
7; RUN: sed -e "s/LANG_C/LANG_C89/" %s > %t/test.ll
8; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj -o %t/test.o < %t/test.ll
9; RUN: llvm-dwarfdump -debug-info %t/test.o | FileCheck %s
10
11; RUN: sed -e "s/LANG_C/LANG_C99/" %s > %t/test.ll
12; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj -o %t/test.o < %t/test.ll
13; RUN: llvm-dwarfdump -debug-info %t/test.o | FileCheck %s
14
15; RUN: sed -e "s/LANG_C/LANG_C11/" %s > %t/test.ll
16; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj -o %t/test.o < %t/test.ll
17; RUN: llvm-dwarfdump -debug-info %t/test.o | FileCheck %s
18
19; RUN: sed -e "s/LANG_C/LANG_ObjC/" %s > %t/test.ll
20; RUN: llc -mtriple=x86_64-pc-linux-gnu -filetype=obj -o %t/test.o < %t/test.ll
21; RUN: llvm-dwarfdump -debug-info %t/test.o | FileCheck %s
22
23; Generated from this simple example, compiled as C code:
24; void (*x)(void);
25; void y(void) { }
26
27; CHECK: DW_TAG_subroutine_type
28; CHECK-NOT: {{DW_TAG|NULL}}
29; CHECK:   DW_AT_prototyped (true)
30
31; CHECK: DW_TAG_subprogram
32; CHECK-NOT: {{DW_TAG|NULL}}
33; CHECK:   DW_AT_prototyped (true)
34
35@x = dso_local global ptr null, align 8, !dbg !0
36
37; Function Attrs: noinline nounwind optnone uwtable
38define dso_local void @y() #0 !dbg !16 {
39entry:
40  ret void, !dbg !18
41}
42
43attributes #0 = { noinline nounwind optnone uwtable "frame-pointer"="all" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
44
45!llvm.dbg.cu = !{!2}
46!llvm.module.flags = !{!8, !9, !10, !11, !12, !13, !14}
47!llvm.ident = !{!15}
48
49!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
50!1 = distinct !DIGlobalVariable(name: "x", scope: !2, file: !3, line: 1, type: !5, isLocal: false, isDefinition: true)
51!2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "clang version 16.0.0 (git@github.com:llvm/llvm-project.git 4ffde47ab8c2790c8ee2867eccb9f41c329c9e99)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !4, splitDebugInlining: false, nameTableKind: None)
52!3 = !DIFile(filename: "test.c", directory: "/usr/local/google/home/blaikie/dev/scratch", checksumkind: CSK_MD5, checksum: "02049edb47c3f3ebb7dfd6ed0658ec6b")
53!4 = !{!0}
54!5 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !6, size: 64)
55!6 = !DISubroutineType(types: !7)
56!7 = !{null}
57!8 = !{i32 7, !"Dwarf Version", i32 5}
58!9 = !{i32 2, !"Debug Info Version", i32 3}
59!10 = !{i32 1, !"wchar_size", i32 4}
60!11 = !{i32 8, !"PIC Level", i32 2}
61!12 = !{i32 7, !"PIE Level", i32 2}
62!13 = !{i32 7, !"uwtable", i32 2}
63!14 = !{i32 7, !"frame-pointer", i32 2}
64!15 = !{!"clang version 16.0.0 (git@github.com:llvm/llvm-project.git 4ffde47ab8c2790c8ee2867eccb9f41c329c9e99)"}
65!16 = distinct !DISubprogram(name: "y", scope: !3, file: !3, line: 2, type: !6, scopeLine: 2, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !17)
66!17 = !{}
67!18 = !DILocation(line: 2, column: 16, scope: !16)
68