xref: /aosp_15_r20/external/llvm/test/DebugInfo/X86/byvalstruct.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc  -mtriple=x86_64-apple-macosx10.8.0 -O0 -filetype=obj -o %t %s
2*9880d681SAndroid Build Coastguard Worker; RUN: llvm-dwarfdump -debug-dump=info %t | FileCheck %s
3*9880d681SAndroid Build Coastguard Worker; Test that we generate debug info for by-value struct args that are not used.
4*9880d681SAndroid Build Coastguard Worker;
5*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_formal_parameter
6*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_formal_parameter
7*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_formal_parameter
8*9880d681SAndroid Build Coastguard Worker; CHECK: DW_TAG_formal_parameter
9*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: DW_TAG
10*9880d681SAndroid Build Coastguard Worker; CHECK: DW_AT_name {{.*}} "info"
11*9880d681SAndroid Build Coastguard Worker;
12*9880d681SAndroid Build Coastguard Worker; generated from
13*9880d681SAndroid Build Coastguard Worker;
14*9880d681SAndroid Build Coastguard Worker; typedef unsigned long NSUInteger;
15*9880d681SAndroid Build Coastguard Worker; typedef struct
16*9880d681SAndroid Build Coastguard Worker; {
17*9880d681SAndroid Build Coastguard Worker;  NSUInteger width;
18*9880d681SAndroid Build Coastguard Worker;  NSUInteger height;
19*9880d681SAndroid Build Coastguard Worker;  double pixelAspect;
20*9880d681SAndroid Build Coastguard Worker; } ImageInfo;
21*9880d681SAndroid Build Coastguard Worker; @implementation Bitmap
22*9880d681SAndroid Build Coastguard Worker; - (id)initWithCopy:(Bitmap *)otherBitmap
23*9880d681SAndroid Build Coastguard Worker;            andInfo:(ImageInfo)info
24*9880d681SAndroid Build Coastguard Worker;        andLength:(NSUInteger)length
25*9880d681SAndroid Build Coastguard Worker; {
26*9880d681SAndroid Build Coastguard Worker; }
27*9880d681SAndroid Build Coastguard Worker; @end
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Worker; ModuleID = 't.mm'
30*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
31*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-macosx10.8.0"
32*9880d681SAndroid Build Coastguard Worker
33*9880d681SAndroid Build Coastguard Worker%0 = type opaque
34*9880d681SAndroid Build Coastguard Worker%struct._objc_cache = type opaque
35*9880d681SAndroid Build Coastguard Worker%struct._class_t = type { %struct._class_t*, %struct._class_t*, %struct._objc_cache*, i8* (i8*, i8*)**, %struct._class_ro_t* }
36*9880d681SAndroid Build Coastguard Worker%struct._class_ro_t = type { i32, i32, i32, i8*, i8*, %struct.__method_list_t*, %struct._objc_protocol_list*, %struct._ivar_list_t*, i8*, %struct._prop_list_t* }
37*9880d681SAndroid Build Coastguard Worker%struct.__method_list_t = type { i32, i32, [0 x %struct._objc_method] }
38*9880d681SAndroid Build Coastguard Worker%struct._objc_method = type { i8*, i8*, i8* }
39*9880d681SAndroid Build Coastguard Worker%struct._objc_protocol_list = type { i64, [0 x %struct._protocol_t*] }
40*9880d681SAndroid Build Coastguard Worker%struct._protocol_t = type { i8*, i8*, %struct._objc_protocol_list*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct.__method_list_t*, %struct._prop_list_t*, i32, i32, i8** }
41*9880d681SAndroid Build Coastguard Worker%struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] }
42*9880d681SAndroid Build Coastguard Worker%struct._prop_t = type { i8*, i8* }
43*9880d681SAndroid Build Coastguard Worker%struct._ivar_list_t = type { i32, i32, [0 x %struct._ivar_t] }
44*9880d681SAndroid Build Coastguard Worker%struct._ivar_t = type { i64*, i8*, i8*, i32, i32 }
45*9880d681SAndroid Build Coastguard Worker%struct.ImageInfo = type { i64, i64, double }
46*9880d681SAndroid Build Coastguard Worker
47*9880d681SAndroid Build Coastguard Worker@_objc_empty_cache = external global %struct._objc_cache
48*9880d681SAndroid Build Coastguard Worker@_objc_empty_vtable = external global i8* (i8*, i8*)*
49*9880d681SAndroid Build Coastguard Worker@"OBJC_CLASS_$_Bitmap" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_Bitmap", %struct._class_t* null, %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** @_objc_empty_vtable, %struct._class_ro_t* @"\01l_OBJC_CLASS_RO_$_Bitmap" }, section "__DATA, __objc_data", align 8
50*9880d681SAndroid Build Coastguard Worker@"OBJC_METACLASS_$_Bitmap" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_Bitmap", %struct._class_t* @"OBJC_CLASS_$_Bitmap", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** @_objc_empty_vtable, %struct._class_ro_t* @"\01l_OBJC_METACLASS_RO_$_Bitmap" }, section "__DATA, __objc_data", align 8
51*9880d681SAndroid Build Coastguard Worker@"\01L_OBJC_CLASS_NAME_" = internal global [7 x i8] c"Bitmap\00", section "__TEXT,__objc_classname,cstring_literals", align 1
52*9880d681SAndroid Build Coastguard Worker@"\01l_OBJC_METACLASS_RO_$_Bitmap" = internal global %struct._class_ro_t { i32 3, i32 40, i32 40, i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), %struct.__method_list_t* null, %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8
53*9880d681SAndroid Build Coastguard Worker@"\01L_OBJC_METH_VAR_NAME_" = internal global [32 x i8] c"initWithCopy:andInfo:andLength:\00", section "__TEXT,__objc_methname,cstring_literals", align 1
54*9880d681SAndroid Build Coastguard Worker@"\01L_OBJC_METH_VAR_TYPE_" = internal global [23 x i8] c"@56@0:8@16{?=QQd}24Q48\00", section "__TEXT,__objc_methtype,cstring_literals", align 1
55*9880d681SAndroid Build Coastguard Worker@"\01l_OBJC_$_INSTANCE_METHODS_Bitmap" = internal global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([32 x i8], [32 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @"\01L_OBJC_METH_VAR_TYPE_", i32 0, i32 0), i8* bitcast (i8* (%0*, i8*, %0*, %struct.ImageInfo*, i64)* @"\01-[Bitmap initWithCopy:andInfo:andLength:]" to i8*) }] }, section "__DATA, __objc_const", align 8
56*9880d681SAndroid Build Coastguard Worker@"\01l_OBJC_CLASS_RO_$_Bitmap" = internal global %struct._class_ro_t { i32 2, i32 0, i32 0, i8* null, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), %struct.__method_list_t* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_INSTANCE_METHODS_Bitmap" to %struct.__method_list_t*), %struct._objc_protocol_list* null, %struct._ivar_list_t* null, i8* null, %struct._prop_list_t* null }, section "__DATA, __objc_const", align 8
57*9880d681SAndroid Build Coastguard Worker@"\01L_OBJC_LABEL_CLASS_$" = internal global [1 x i8*] [i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_Bitmap" to i8*)], section "__DATA, __objc_classlist, regular, no_dead_strip", align 8
58*9880d681SAndroid Build Coastguard Worker@llvm.used = appending global [5 x i8*] [i8* getelementptr inbounds ([7 x i8], [7 x i8]* @"\01L_OBJC_CLASS_NAME_", i32 0, i32 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @"\01L_OBJC_METH_VAR_NAME_", i32 0, i32 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @"\01L_OBJC_METH_VAR_TYPE_", i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_INSTANCE_METHODS_Bitmap" to i8*), i8* bitcast ([1 x i8*]* @"\01L_OBJC_LABEL_CLASS_$" to i8*)], section "llvm.metadata"
59*9880d681SAndroid Build Coastguard Worker
60*9880d681SAndroid Build Coastguard Worker; Function Attrs: ssp uwtable
61*9880d681SAndroid Build Coastguard Workerdefine internal i8* @"\01-[Bitmap initWithCopy:andInfo:andLength:]"(%0* %self, i8* %_cmd, %0* %otherBitmap, %struct.ImageInfo* byval align 8 %info, i64 %length) #0 !dbg !7 {
62*9880d681SAndroid Build Coastguard Workerentry:
63*9880d681SAndroid Build Coastguard Worker  %retval = alloca i8*, align 8
64*9880d681SAndroid Build Coastguard Worker  %self.addr = alloca %0*, align 8
65*9880d681SAndroid Build Coastguard Worker  %_cmd.addr = alloca i8*, align 8
66*9880d681SAndroid Build Coastguard Worker  %otherBitmap.addr = alloca %0*, align 8
67*9880d681SAndroid Build Coastguard Worker  %length.addr = alloca i64, align 8
68*9880d681SAndroid Build Coastguard Worker  store %0* %self, %0** %self.addr, align 8
69*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata %0** %self.addr, metadata !28, metadata !DIExpression()), !dbg !29
70*9880d681SAndroid Build Coastguard Worker  store i8* %_cmd, i8** %_cmd.addr, align 8
71*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata i8** %_cmd.addr, metadata !30, metadata !DIExpression()), !dbg !29
72*9880d681SAndroid Build Coastguard Worker  store %0* %otherBitmap, %0** %otherBitmap.addr, align 8
73*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata %0** %otherBitmap.addr, metadata !32, metadata !DIExpression()), !dbg !29
74*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata %struct.ImageInfo* %info, metadata !33, metadata !DIExpression()), !dbg !34
75*9880d681SAndroid Build Coastguard Worker  store i64 %length, i64* %length.addr, align 8
76*9880d681SAndroid Build Coastguard Worker  call void @llvm.dbg.declare(metadata i64* %length.addr, metadata !35, metadata !DIExpression()), !dbg !36
77*9880d681SAndroid Build Coastguard Worker  %0 = load i8*, i8** %retval, !dbg !37
78*9880d681SAndroid Build Coastguard Worker  ret i8* %0, !dbg !37
79*9880d681SAndroid Build Coastguard Worker}
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Worker; Function Attrs: nounwind readnone
82*9880d681SAndroid Build Coastguard Workerdeclare void @llvm.dbg.declare(metadata, metadata, metadata) #1
83*9880d681SAndroid Build Coastguard Worker
84*9880d681SAndroid Build Coastguard Workerattributes #0 = { ssp uwtable }
85*9880d681SAndroid Build Coastguard Workerattributes #1 = { nounwind readnone }
86*9880d681SAndroid Build Coastguard Worker
87*9880d681SAndroid Build Coastguard Worker!llvm.dbg.cu = !{!0}
88*9880d681SAndroid Build Coastguard Worker!llvm.module.flags = !{!24, !25, !26, !27, !38}
89*9880d681SAndroid Build Coastguard Worker
90*9880d681SAndroid Build Coastguard Worker!0 = distinct !DICompileUnit(language: DW_LANG_ObjC_plus_plus, producer: "clang version 3.4 ", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)
91*9880d681SAndroid Build Coastguard Worker!1 = !DIFile(filename: "t.mm", directory: "")
92*9880d681SAndroid Build Coastguard Worker!2 = !{}
93*9880d681SAndroid Build Coastguard Worker!3 = !{!4}
94*9880d681SAndroid Build Coastguard Worker!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "Bitmap", line: 8, size: 8, align: 8, flags: DIFlagObjcClassComplete, runtimeLang: DW_LANG_ObjC_plus_plus, file: !1, scope: !5, elements: !2)
95*9880d681SAndroid Build Coastguard Worker!5 = !DIFile(filename: "t.mm", directory: "")
96*9880d681SAndroid Build Coastguard Worker!7 = distinct !DISubprogram(name: "-[Bitmap initWithCopy:andInfo:andLength:]", line: 9, isLocal: true, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 9, file: !1, scope: !5, type: !8, variables: !2)
97*9880d681SAndroid Build Coastguard Worker!8 = !DISubroutineType(types: !9)
98*9880d681SAndroid Build Coastguard Worker!9 = !{!4, !10, !11, !14, !15, !19}
99*9880d681SAndroid Build Coastguard Worker!10 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)
100*9880d681SAndroid Build Coastguard Worker!11 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", line: 9, flags: DIFlagArtificial, file: !1, baseType: !12)
101*9880d681SAndroid Build Coastguard Worker!12 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !13)
102*9880d681SAndroid Build Coastguard Worker!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_selector", flags: DIFlagFwdDecl, file: !1)
103*9880d681SAndroid Build Coastguard Worker!14 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)
104*9880d681SAndroid Build Coastguard Worker!15 = !DIDerivedType(tag: DW_TAG_typedef, name: "ImageInfo", line: 7, file: !1, baseType: !16)
105*9880d681SAndroid Build Coastguard Worker!16 = !DICompositeType(tag: DW_TAG_structure_type, line: 2, size: 192, align: 64, file: !1, elements: !17)
106*9880d681SAndroid Build Coastguard Worker!17 = !{!18, !21, !22}
107*9880d681SAndroid Build Coastguard Worker!18 = !DIDerivedType(tag: DW_TAG_member, name: "width", line: 4, size: 64, align: 64, file: !1, scope: !16, baseType: !19)
108*9880d681SAndroid Build Coastguard Worker!19 = !DIDerivedType(tag: DW_TAG_typedef, name: "NSUInteger", line: 1, file: !1, baseType: !20)
109*9880d681SAndroid Build Coastguard Worker!20 = !DIBasicType(tag: DW_TAG_base_type, name: "long unsigned int", size: 64, align: 64, encoding: DW_ATE_unsigned)
110*9880d681SAndroid Build Coastguard Worker!21 = !DIDerivedType(tag: DW_TAG_member, name: "height", line: 5, size: 64, align: 64, offset: 64, file: !1, scope: !16, baseType: !19)
111*9880d681SAndroid Build Coastguard Worker!22 = !DIDerivedType(tag: DW_TAG_member, name: "pixelAspect", line: 6, size: 64, align: 64, offset: 128, file: !1, scope: !16, baseType: !23)
112*9880d681SAndroid Build Coastguard Worker!23 = !DIBasicType(tag: DW_TAG_base_type, name: "double", size: 64, align: 64, encoding: DW_ATE_float)
113*9880d681SAndroid Build Coastguard Worker!24 = !{i32 1, !"Objective-C Version", i32 2}
114*9880d681SAndroid Build Coastguard Worker!25 = !{i32 1, !"Objective-C Image Info Version", i32 0}
115*9880d681SAndroid Build Coastguard Worker!26 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"}
116*9880d681SAndroid Build Coastguard Worker!27 = !{i32 4, !"Objective-C Garbage Collection", i32 0}
117*9880d681SAndroid Build Coastguard Worker!28 = !DILocalVariable(name: "self", line: 9, arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !7, file: !5, type: !14)
118*9880d681SAndroid Build Coastguard Worker!29 = !DILocation(line: 9, scope: !7)
119*9880d681SAndroid Build Coastguard Worker!30 = !DILocalVariable(name: "_cmd", line: 9, arg: 2, flags: DIFlagArtificial, scope: !7, file: !5, type: !31)
120*9880d681SAndroid Build Coastguard Worker!31 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", line: 9, file: !1, baseType: !12)
121*9880d681SAndroid Build Coastguard Worker!32 = !DILocalVariable(name: "otherBitmap", line: 9, arg: 3, scope: !7, file: !5, type: !14)
122*9880d681SAndroid Build Coastguard Worker!33 = !DILocalVariable(name: "info", line: 10, arg: 4, scope: !7, file: !5, type: !15)
123*9880d681SAndroid Build Coastguard Worker!34 = !DILocation(line: 10, scope: !7)
124*9880d681SAndroid Build Coastguard Worker!35 = !DILocalVariable(name: "length", line: 11, arg: 5, scope: !7, file: !5, type: !19)
125*9880d681SAndroid Build Coastguard Worker!36 = !DILocation(line: 11, scope: !7)
126*9880d681SAndroid Build Coastguard Worker!37 = !DILocation(line: 13, scope: !7)
127*9880d681SAndroid Build Coastguard Worker!38 = !{i32 1, !"Debug Info Version", i32 3}
128