xref: /llvm-project/llvm/test/DebugInfo/X86/objc_direct.ll (revision 5a288fa32e0c91b211e39f3e370255916902f898)
1; RUN: llc < %s -mtriple=x86_64 -filetype=obj -o %t
2; RUN: llvm-dwarfdump -v %t | FileCheck %s
3
4; Source code to regenerate:
5; __attribute__((objc_root_class))
6; @interface Root
7; - (int)direct_method __attribute__((objc_direct));
8; @end
9;
10; @implementation Root
11; - (int)direct_method __attribute__((objc_direct)) {
12;   return 42;
13; }
14; @end
15;
16; clang -O0 -g -gdwarf-5 direct.m -c
17
18; CHECK: DW_TAG_subprogram [3]
19; CHECK: DW_AT_APPLE_objc_direct
20; CHECK-SAME: DW_FORM_flag_present
21; CHECK: DW_TAG_formal_parameter [4]
22
23; ModuleID = 'direct.bc'
24source_filename = "direct.m"
25
26%0 = type opaque
27
28define hidden i32 @"\01-[Root direct_method]"(ptr %self, ptr %_cmd) {
29entry:
30  %retval = alloca i32, align 4
31  %0 = load i32, ptr %retval, align 4
32  ret i32 %0
33}
34
35!llvm.dbg.cu = !{!0}
36!llvm.module.flags = !{!19, !20}
37!llvm.ident = !{}
38
39!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !1, producer: "clang version 10.0.0 (https://github.com/llvm/llvm-project d6b2f33e2b6338d24cf756ba220939aecc81210d)", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, enums: !2, retainedTypes: !3, nameTableKind: None)
40!1 = !DIFile(filename: "direct.m", directory: "/", checksumkind: CSK_MD5, checksum: "6b49fad130344b0011fc0eef65949390")
41!2 = !{}
42!3 = !{!4}
43!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Root", scope: !1, file: !1, line: 2, flags: DIFlagObjcClassComplete, elements: !5, runtimeLang: DW_LANG_ObjC)
44!5 = !{!6}
45!6 = !DISubprogram(name: "-[Root direct_method]", scope: !4, file: !1, line: 7, type: !7, scopeLine: 7, flags: DIFlagPrototyped, spFlags: DISPFlagObjCDirect, retainedNodes: !2)
46!7 = !DISubroutineType(types: !8)
47!8 = !{!9, !10, !11}
48!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
49!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !4, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
50!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", file: !1, baseType: !12, flags: DIFlagArtificial)
51!12 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !13, size: 64)
52!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_selector", file: !1, flags: DIFlagFwdDecl)
53!19 = !{i32 7, !"Dwarf Version", i32 5}
54!20 = !{i32 2, !"Debug Info Version", i32 3}
55