Imported Upstream version 5.18.0.234

Former-commit-id: 8071ec1a8c5eaa9be24b41745add19297608001f
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2019-01-08 08:22:36 +00:00
parent f32dbaf0b2
commit 212f6bafcb
28494 changed files with 359 additions and 3867025 deletions

View File

@@ -1,324 +0,0 @@
; RUN: llc -O0 -fast-isel -filetype=obj -o - %s | llvm-dwarfdump -v - | FileCheck %s
;
; Derived from (clang -O0 -g -fsanitize=address -fobjc-arc)
; @protocol NSObject
; @end
; @interface NSObject<NSObject>{}
; + (instancetype)alloc;
; @end
; struct CGSize {
; double width;
; double height;
; };
; typedef struct CGSize CGSize;
; @interface Object : NSObject
; - (instancetype)initWithSize:(CGSize)size;
; - (id)aMessage;
; @end
; @implementation MyObject
; + (id)doWithSize:(CGSize)imageSize andObject:(id)object {
; return [object aMessage];
; }
; @end
;
; CHECK: .debug_info contents:
; CHECK: DW_TAG_subprogram
; CHECK-NEXT: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
; CHECK-NEXT: DW_AT_high_pc [DW_FORM_addr] ([[FN_END:.*]])
; CHECK: "_cmd"
; CHECK: DW_TAG_formal_parameter
; CHECK-NEXT: DW_AT_location
; CHECK-NEXT: 0x{{0*}} - 0x{{.*}}:
; CHECK-NOT: DW_AT_
; CHECK: 0x{{.*}} - [[FN_END]]:
; CHECK-NEXT: DW_AT_name {{.*}}"imageSize"
; ModuleID = 'm.m'
source_filename = "m.m"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios"
%0 = type opaque
%struct._class_t = type { %struct._class_t*, %struct._class_t*, %struct._objc_cache*, i8* (i8*, i8*)**, %struct._class_ro_t* }
%struct._objc_cache = type opaque
%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* }
%struct.__method_list_t = type { i32, i32, [0 x %struct._objc_method] }
%struct._objc_method = type { i8*, i8*, i8* }
%struct._objc_protocol_list = type { i64, [0 x %struct._protocol_t*] }
%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**, i8*, %struct._prop_list_t* }
%struct._ivar_list_t = type { i32, i32, [0 x %struct._ivar_t] }
%struct._ivar_t = type { i32*, i8*, i8*, i32, i32 }
%struct._prop_list_t = type { i32, i32, [0 x %struct._prop_t] }
%struct._prop_t = type { i8*, i8* }
%struct.CGSize = type { double, double }
@"OBJC_CLASS_$_Object" = external global %struct._class_t
@"OBJC_CLASSLIST_REFERENCES_$_" = private global %struct._class_t* @"OBJC_CLASS_$_Object", section "__DATA, __objc_classrefs, regular, no_dead_strip", align 8
@OBJC_METH_VAR_NAME_ = private unnamed_addr constant [6 x i8] c"alloc\00", section "__TEXT,__objc_methname,cstring_literals", align 1
@OBJC_SELECTOR_REFERENCES_ = private externally_initialized global i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip", align 8
@OBJC_METH_VAR_NAME_.1 = private unnamed_addr constant [14 x i8] c"initWithSize:\00", section "__TEXT,__objc_methname,cstring_literals", align 1
@OBJC_SELECTOR_REFERENCES_.2 = private externally_initialized global i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.1, i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip", align 8
@OBJC_METH_VAR_NAME_.3 = private unnamed_addr constant [9 x i8] c"aMessage\00", section "__TEXT,__objc_methname,cstring_literals", align 1
@OBJC_SELECTOR_REFERENCES_.4 = private externally_initialized global i8* getelementptr inbounds ([9 x i8], [9 x i8]* @OBJC_METH_VAR_NAME_.3, i32 0, i32 0), section "__DATA, __objc_selrefs, literal_pointers, no_dead_strip", align 8
@_objc_empty_cache = external global %struct._objc_cache
@"OBJC_CLASS_$_MyObject" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_MyObject", %struct._class_t* null, %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"\01l_OBJC_CLASS_RO_$_MyObject" }, section "__DATA, __objc_data", align 8
@"OBJC_METACLASS_$_MyObject" = global %struct._class_t { %struct._class_t* @"OBJC_METACLASS_$_MyObject", %struct._class_t* @"OBJC_CLASS_$_MyObject", %struct._objc_cache* @_objc_empty_cache, i8* (i8*, i8*)** null, %struct._class_ro_t* @"\01l_OBJC_METACLASS_RO_$_MyObject" }, section "__DATA, __objc_data", align 8
@OBJC_CLASS_NAME_ = private unnamed_addr constant [9 x i8] c"MyObject\00", section "__TEXT,__objc_classname,cstring_literals", align 1
@OBJC_METH_VAR_NAME_.5 = private unnamed_addr constant [12 x i8] c"doWithSize:\00", section "__TEXT,__objc_methname,cstring_literals", align 1
@OBJC_METH_VAR_TYPE_ = private unnamed_addr constant [21 x i8] c"@32@0:8{CGSize=dd}16\00", section "__TEXT,__objc_methtype,cstring_literals", align 1
@"\01l_OBJC_$_CLASS_METHODS_MyObject" = private global { i32, i32, [1 x %struct._objc_method] } { i32 24, i32 1, [1 x %struct._objc_method] [%struct._objc_method { i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_.5, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast (i8* (i8*, i8*, [2 x double])* @"\01+[MyObject doWithSize:]" to i8*) }] }, section "__DATA, __objc_const", align 8
@"\01l_OBJC_METACLASS_RO_$_MyObject" = private global %struct._class_ro_t { i32 131, i32 40, i32 40, i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), %struct.__method_list_t* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_CLASS_METHODS_MyObject" 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
@"\01l_OBJC_CLASS_RO_$_MyObject" = private global %struct._class_ro_t { i32 130, i32 0, i32 0, i8* null, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @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
@"OBJC_LABEL_CLASS_$" = private global [1 x i8*] [i8* bitcast (%struct._class_t* @"OBJC_CLASS_$_MyObject" to i8*)], section "__DATA, __objc_classlist, regular, no_dead_strip", align 8
@llvm.compiler.used = appending global [12 x i8*] [i8* bitcast (%struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_" to i8*), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @OBJC_METH_VAR_NAME_, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_ to i8*), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @OBJC_METH_VAR_NAME_.1, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.2 to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @OBJC_METH_VAR_NAME_.3, i32 0, i32 0), i8* bitcast (i8** @OBJC_SELECTOR_REFERENCES_.4 to i8*), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @OBJC_CLASS_NAME_, i32 0, i32 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @OBJC_METH_VAR_NAME_.5, i32 0, i32 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @OBJC_METH_VAR_TYPE_, i32 0, i32 0), i8* bitcast ({ i32, i32, [1 x %struct._objc_method] }* @"\01l_OBJC_$_CLASS_METHODS_MyObject" to i8*), i8* bitcast ([1 x i8*]* @"OBJC_LABEL_CLASS_$" to i8*)], section "llvm.metadata"
@llvm.global_ctors = appending global [1 x { i32, void ()*, i8* }] [{ i32, void ()*, i8* } { i32 1, void ()* @asan.module_ctor, i8* null }]
@__asan_shadow_memory_dynamic_address = external global i64
@__asan_gen_ = private unnamed_addr constant [34 x i8] c"2 32 16 9 imageSize 64 8 6 object\00", align 1
; Function Attrs: noinline sanitize_address ssp uwtable
define internal i8* @"\01+[MyObject doWithSize:]"(i8* %self, i8* %_cmd, [2 x double] %imageSize.coerce) #0 !dbg !14 {
entry:
%0 = load i64, i64* @__asan_shadow_memory_dynamic_address
%self.addr = alloca i8*, align 8
%_cmd.addr = alloca i8*, align 8
%MyAlloca = alloca [96 x i8], align 32, !dbg !35
%1 = ptrtoint [96 x i8]* %MyAlloca to i64, !dbg !35
%2 = add i64 %1, 32, !dbg !35
%3 = inttoptr i64 %2 to %struct.CGSize*, !dbg !35
%4 = add i64 %1, 64, !dbg !35
%5 = inttoptr i64 %4 to %0**, !dbg !35
%6 = inttoptr i64 %1 to i64*, !dbg !35
store i64 1102416563, i64* %6, !dbg !35
%7 = add i64 %1, 8, !dbg !35
%8 = inttoptr i64 %7 to i64*, !dbg !35
store i64 ptrtoint ([34 x i8]* @__asan_gen_ to i64), i64* %8, !dbg !35
%9 = add i64 %1, 16, !dbg !35
%10 = inttoptr i64 %9 to i64*, !dbg !35
store i64 ptrtoint (i8* (i8*, i8*, [2 x double])* @"\01+[MyObject doWithSize:]" to i64), i64* %10, !dbg !35
%11 = lshr i64 %1, 3, !dbg !35
%12 = add i64 %11, %0, !dbg !35
%13 = add i64 %12, 0, !dbg !35
%14 = inttoptr i64 %13 to i64*, !dbg !35
store i64 -940689368107847183, i64* %14, align 1, !dbg !35
%15 = add i64 %12, 9, !dbg !35
%16 = inttoptr i64 %15 to i16*, !dbg !35
store i16 -3085, i16* %16, align 1, !dbg !35
%17 = add i64 %12, 11, !dbg !35
%18 = inttoptr i64 %17 to i8*, !dbg !35
store i8 -13, i8* %18, align 1, !dbg !35
call void @llvm.dbg.declare(metadata %struct.CGSize* %3, metadata !36, metadata !37), !dbg !38
call void @llvm.dbg.declare(metadata %0** %5, metadata !39, metadata !37), !dbg !45
%19 = bitcast %struct.CGSize* %3 to [2 x double]*
%20 = ptrtoint [2 x double]* %19 to i64
%21 = lshr i64 %20, 3
%22 = add i64 %21, %0
%23 = inttoptr i64 %22 to i16*
%24 = load i16, i16* %23
%25 = icmp ne i16 %24, 0
br i1 %25, label %26, label %27
; <label>:26: ; preds = %entry
call void @__asan_report_store16(i64 %20)
call void asm sideeffect "", ""()
unreachable
; <label>:27: ; preds = %entry
store [2 x double] %imageSize.coerce, [2 x double]* %19, align 8
store i8* %self, i8** %self.addr, align 8
call void @llvm.dbg.declare(metadata i8** %self.addr, metadata !46, metadata !48), !dbg !49
store i8* %_cmd, i8** %_cmd.addr, align 8
call void @llvm.dbg.declare(metadata i8** %_cmd.addr, metadata !50, metadata !48), !dbg !49
%28 = load %struct._class_t*, %struct._class_t** @"OBJC_CLASSLIST_REFERENCES_$_", align 8, !dbg !52
%29 = add i64 lshr (i64 ptrtoint (i8** @OBJC_SELECTOR_REFERENCES_ to i64), i64 3), %0, !dbg !52
%30 = inttoptr i64 %29 to i8*, !dbg !52
%31 = load i8, i8* %30, !dbg !52
%32 = icmp ne i8 %31, 0, !dbg !52
br i1 %32, label %33, label %34, !dbg !52
; <label>:33: ; preds = %27
call void @__asan_report_load8(i64 ptrtoint (i8** @OBJC_SELECTOR_REFERENCES_ to i64)), !dbg !52
call void asm sideeffect "", ""(), !dbg !52
unreachable, !dbg !52
; <label>:34: ; preds = %27
%35 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_, align 8, !dbg !52, !invariant.load !2
%36 = bitcast %struct._class_t* %28 to i8*, !dbg !52
%call = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %36, i8* %35), !dbg !52
%37 = bitcast i8* %call to %0*, !dbg !52
%38 = add i64 lshr (i64 ptrtoint (i8** @OBJC_SELECTOR_REFERENCES_.2 to i64), i64 3), %0, !dbg !53
%39 = inttoptr i64 %38 to i8*, !dbg !53
%40 = load i8, i8* %39, !dbg !53
%41 = icmp ne i8 %40, 0, !dbg !53
br i1 %41, label %42, label %43, !dbg !53
; <label>:42: ; preds = %34
call void @__asan_report_load8(i64 ptrtoint (i8** @OBJC_SELECTOR_REFERENCES_.2 to i64)), !dbg !53
call void asm sideeffect "", ""(), !dbg !53
unreachable, !dbg !53
; <label>:43: ; preds = %34
%44 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.2, align 8, !dbg !53, !invariant.load !2
%45 = bitcast %0* %37 to i8*, !dbg !53
%46 = bitcast %struct.CGSize* %3 to [2 x double]*, !dbg !53
%47 = ptrtoint [2 x double]* %46 to i64, !dbg !53
%48 = lshr i64 %47, 3, !dbg !53
%49 = add i64 %48, %0, !dbg !53
%50 = inttoptr i64 %49 to i16*, !dbg !53
%51 = load i16, i16* %50, !dbg !53
%52 = icmp ne i16 %51, 0, !dbg !53
br i1 %52, label %53, label %54, !dbg !53
; <label>:53: ; preds = %43
call void @__asan_report_load16(i64 %47), !dbg !53
call void asm sideeffect "", ""(), !dbg !53
unreachable, !dbg !53
; <label>:54: ; preds = %43
%55 = load [2 x double], [2 x double]* %46, align 8, !dbg !53
%call1 = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*, [2 x double])*)(i8* %45, i8* %44, [2 x double] %55), !dbg !53
%56 = bitcast i8* %call1 to %0*, !dbg !53
%57 = ptrtoint %0** %5 to i64, !dbg !45
%58 = lshr i64 %57, 3, !dbg !45
%59 = add i64 %58, %0, !dbg !45
%60 = inttoptr i64 %59 to i8*, !dbg !45
%61 = load i8, i8* %60, !dbg !45
%62 = icmp ne i8 %61, 0, !dbg !45
br i1 %62, label %63, label %64, !dbg !45
; <label>:63: ; preds = %54
call void @__asan_report_store8(i64 %57), !dbg !45
call void asm sideeffect "", ""(), !dbg !45
unreachable, !dbg !45
; <label>:64: ; preds = %54
store %0* %56, %0** %5, align 8, !dbg !45
%65 = load %0*, %0** %5, align 8, !dbg !54
%66 = add i64 lshr (i64 ptrtoint (i8** @OBJC_SELECTOR_REFERENCES_.4 to i64), i64 3), %0, !dbg !55
%67 = inttoptr i64 %66 to i8*, !dbg !55
%68 = load i8, i8* %67, !dbg !55
%69 = icmp ne i8 %68, 0, !dbg !55
br i1 %69, label %70, label %71, !dbg !55
; <label>:70: ; preds = %64
call void @__asan_report_load8(i64 ptrtoint (i8** @OBJC_SELECTOR_REFERENCES_.4 to i64)), !dbg !55
call void asm sideeffect "", ""(), !dbg !55
unreachable, !dbg !55
; <label>:71: ; preds = %64
%72 = load i8*, i8** @OBJC_SELECTOR_REFERENCES_.4, align 8, !dbg !55, !invariant.load !2
%73 = bitcast %0* %65 to i8*, !dbg !55
%call2 = call i8* bitcast (i8* (i8*, i8*, ...)* @objc_msgSend to i8* (i8*, i8*)*)(i8* %73, i8* %72), !dbg !55
call void asm sideeffect "mov\09fp, fp\09\09; marker for objc_retainAutoreleaseReturnValue", ""(), !dbg !55
%74 = call i8* @objc_retainAutoreleasedReturnValue(i8* %call2) #3, !dbg !55
%75 = bitcast %0** %5 to i8**, !dbg !56
call void @objc_storeStrong(i8** %75, i8* null) #3, !dbg !56
%76 = tail call i8* @objc_autoreleaseReturnValue(i8* %74) #3, !dbg !56
store i64 1172321806, i64* %6, !dbg !56
%77 = add i64 %12, 0, !dbg !56
%78 = inttoptr i64 %77 to i64*, !dbg !56
store i64 0, i64* %78, align 1, !dbg !56
%79 = add i64 %12, 9, !dbg !56
%80 = inttoptr i64 %79 to i16*, !dbg !56
store i16 0, i16* %80, align 1, !dbg !56
%81 = add i64 %12, 11, !dbg !56
%82 = inttoptr i64 %81 to i8*, !dbg !56
store i8 0, i8* %82, align 1, !dbg !56
ret i8* %76, !dbg !56
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
; Function Attrs: nonlazybind
declare i8* @objc_msgSend(i8*, i8*, ...) #2
declare i8* @objc_retainAutoreleasedReturnValue(i8* returned)
declare void @objc_storeStrong(i8**, i8*)
declare i8* @objc_autoreleaseReturnValue(i8* returned)
define internal void @asan.module_ctor() {
call void @__asan_init()
call void @__asan_version_mismatch_check_v8()
ret void
}
declare void @__asan_init()
declare void @__asan_version_mismatch_check_v8()
declare void @__asan_report_load8(i64)
declare void @__asan_report_load16(i64)
declare void @__asan_report_store8(i64)
declare void @__asan_report_store16(i64)
attributes #0 = { noinline sanitize_address ssp uwtable }
attributes #1 = { nounwind readnone }
attributes #2 = { nonlazybind }
attributes #3 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!5, !6, !7, !8, !9, !10, !11, !12}
!llvm.ident = !{!13}
!0 = distinct !DICompileUnit(language: DW_LANG_ObjC, file: !1, producer: "clang version 5.0.0 (trunk 295779) (llvm/trunk 295777)", isOptimized: false, runtimeVersion: 2, emissionKind: FullDebug, enums: !2, retainedTypes: !3)
!1 = !DIFile(filename: "m.m", directory: "/")
!2 = !{}
!3 = !{!4}
!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "MyObject", scope: !1, file: !1, line: 15, flags: DIFlagObjcClassComplete, elements: !2, runtimeLang: DW_LANG_ObjC)
!5 = !{i32 1, !"Objective-C Version", i32 2}
!6 = !{i32 1, !"Objective-C Image Info Version", i32 0}
!7 = !{i32 1, !"Objective-C Image Info Section", !"__DATA, __objc_imageinfo, regular, no_dead_strip"}
!8 = !{i32 4, !"Objective-C Garbage Collection", i32 0}
!9 = !{i32 1, !"Objective-C Class Properties", i32 64}
!10 = !{i32 2, !"Dwarf Version", i32 2}
!11 = !{i32 2, !"Debug Info Version", i32 3}
!12 = !{i32 1, !"PIC Level", i32 2}
!13 = !{!"clang version 5.0.0 (trunk 295779) (llvm/trunk 295777)"}
!14 = distinct !DISubprogram(name: "+[MyObject doWithSize:]", scope: !1, file: !1, line: 16, type: !15, isLocal: true, isDefinition: true, scopeLine: 16, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!15 = !DISubroutineType(types: !16)
!16 = !{!17, !24, !26, !29}
!17 = !DIDerivedType(tag: DW_TAG_typedef, name: "id", file: !1, baseType: !18)
!18 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64)
!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_object", file: !1, elements: !20)
!20 = !{!21}
!21 = !DIDerivedType(tag: DW_TAG_member, name: "isa", scope: !19, file: !1, baseType: !22, size: 64)
!22 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !23, size: 64)
!23 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_class", file: !1, flags: DIFlagFwdDecl)
!24 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !25, flags: DIFlagArtificial | DIFlagObjectPointer)
!25 = !DIDerivedType(tag: DW_TAG_typedef, name: "Class", file: !1, baseType: !22)
!26 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", file: !1, baseType: !27, flags: DIFlagArtificial)
!27 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !28, size: 64)
!28 = !DICompositeType(tag: DW_TAG_structure_type, name: "objc_selector", file: !1, flags: DIFlagFwdDecl)
!29 = !DIDerivedType(tag: DW_TAG_typedef, name: "CGSize", file: !1, line: 10, baseType: !30)
!30 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "CGSize", file: !1, line: 6, size: 128, elements: !31)
!31 = !{!32, !34}
!32 = !DIDerivedType(tag: DW_TAG_member, name: "width", scope: !30, file: !1, line: 7, baseType: !33, size: 64)
!33 = !DIBasicType(name: "double", size: 64, encoding: DW_ATE_float)
!34 = !DIDerivedType(tag: DW_TAG_member, name: "height", scope: !30, file: !1, line: 8, baseType: !33, size: 64, offset: 64)
!35 = !DILocation(line: 16, scope: !14)
!36 = !DILocalVariable(name: "imageSize", arg: 3, scope: !14, file: !1, line: 16, type: !29)
!37 = !DIExpression(DW_OP_deref)
!38 = !DILocation(line: 16, column: 26, scope: !14)
!39 = !DILocalVariable(name: "object", scope: !14, file: !1, line: 17, type: !40)
!40 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !41, size: 64)
!41 = !DICompositeType(tag: DW_TAG_structure_type, name: "Object", scope: !1, file: !1, line: 11, elements: !42, runtimeLang: DW_LANG_ObjC)
!42 = !{!43}
!43 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !41, baseType: !44)
!44 = !DICompositeType(tag: DW_TAG_structure_type, name: "NSObject", scope: !1, file: !1, line: 3, elements: !2, runtimeLang: DW_LANG_ObjC)
!45 = !DILocation(line: 17, column: 11, scope: !14)
!46 = !DILocalVariable(name: "self", arg: 1, scope: !14, type: !47, flags: DIFlagArtificial | DIFlagObjectPointer)
!47 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !25)
!48 = !DIExpression()
!49 = !DILocation(line: 0, scope: !14)
!50 = !DILocalVariable(name: "_cmd", arg: 2, scope: !14, type: !51, flags: DIFlagArtificial)
!51 = !DIDerivedType(tag: DW_TAG_typedef, name: "SEL", file: !1, baseType: !27)
!52 = !DILocation(line: 17, column: 21, scope: !14)
!53 = !DILocation(line: 17, column: 20, scope: !14)
!54 = !DILocation(line: 18, column: 11, scope: !14)
!55 = !DILocation(line: 18, column: 10, scope: !14)
!56 = !DILocation(line: 19, column: 1, scope: !14)

View File

@@ -1,16 +0,0 @@
; RUN: llc -O0 -filetype=obj -mtriple=aarch64_be-none-linux < %s | llvm-dwarfdump - | FileCheck %s
; CHECK: file format ELF64-aarch64-big
target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
!0 = !{i32 786449, !1, i32 12, !"clang version 3.6.0 ", i1 false, !"", i32 0, !2, !2, !2, !2, !2, !"", i32 1} ; [ DW_TAG_compile_unit ] [/a/empty.c] [DW_LANG_C99]
!1 = !{!"empty.c", !"/a"}
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 1}
!5 = !{!"clang version 3.6.0 "}

View File

@@ -1,24 +0,0 @@
; RUN: llc %s -filetype=asm -o -
source_filename = "test/DebugInfo/AArch64/big-endian.ll"
target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
target triple = "aarch64_be--none-eabi"
@a = common global i32 0, align 4, !dbg !0
!llvm.dbg.cu = !{!4}
!llvm.module.flags = !{!8, !9}
!llvm.ident = !{!10}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
!2 = !DIFile(filename: "<stdin>", directory: "/work/validation")
!3 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!4 = distinct !DICompileUnit(language: DW_LANG_C99, file: !5, producer: "clang version 3.6.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !6, retainedTypes: !6, globals: !7, imports: !6)
!5 = !DIFile(filename: "-", directory: "/work/validation")
!6 = !{}
!7 = !{!0}
!8 = !{i32 2, !"Dwarf Version", i32 4}
!9 = !{i32 2, !"Debug Info Version", i32 3}
!10 = !{!"clang version 3.6.0 "}

View File

@@ -1,75 +0,0 @@
; RUN: llc -mtriple aarch64_be-gnu-linux -O0 -filetype=obj -o %t_be.o %s
; RUN: llvm-dwarfdump -v -debug-info %t_be.o | FileCheck %s
; Produced at -O0 from:
; struct bitfield {
; int a : 2;
; int b : 32;
; int c : 1;
; int d : 28;
; };
; struct bitfield b;
; Note that DWARF 2 counts bit offsets backwards from the high end of
; the storage unit to the high end of the bit field.
; CHECK: DW_TAG_member
; CHECK-NEXT: DW_AT_name{{.*}}"a"
; CHECK-NOT: DW_TAG_member
; CHECK: DW_AT_byte_size {{.*}} (0x04)
; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x02)
; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x00)
; CHECK-NEXT: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x0)
; CHECK: DW_TAG_member
; CHECK-NEXT: DW_AT_name{{.*}}"b"
; CHECK-NOT: DW_TAG_member
; CHECK: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x4)
; CHECK: DW_TAG_member
; CHECK-NEXT: DW_AT_name{{.*}}"c"
; CHECK-NOT: DW_TAG_member
; CHECK: DW_AT_byte_size {{.*}} (0x04)
; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x01)
; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x00)
; CHECK: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x8)
; CHECK: DW_TAG_member
; CHECK-NEXT: DW_AT_name{{.*}}"d"
; CHECK-NOT: DW_TAG_member
; CHECK: DW_AT_byte_size {{.*}} (0x04)
; CHECK-NEXT: DW_AT_bit_size {{.*}} (0x1c)
; CHECK-NEXT: DW_AT_bit_offset {{.*}} (0x01)
; CHECK-NEXT: DW_AT_data_member_location {{.*}} (DW_OP_plus_uconst 0x8)
; ModuleID = 'bitfields.c'
source_filename = "test/DebugInfo/AArch64/bitfields.ll"
target datalayout = "E-m:e-i64:64-i128:128-n32:64-S128"
target triple = "aarch64_be--linux-gnu"
%struct.bitfield = type <{ i8, [3 x i8], i64 }>
@b = common global %struct.bitfield zeroinitializer, align 4, !dbg !0
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!13, !14, !15}
!llvm.ident = !{!16}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "b", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, retainedTypes: !4, globals: !5, imports: !4)
!3 = !DIFile(filename: "bitfields.c", directory: "/")
!4 = !{}
!5 = !{!0}
!6 = !DICompositeType(tag: DW_TAG_structure_type, name: "bitfield", file: !3, line: 1, size: 96, elements: !7)
!7 = !{!8, !10, !11, !12}
!8 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !6, file: !3, line: 2, baseType: !9, size: 2)
!9 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!10 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !6, file: !3, line: 3, baseType: !9, size: 32, offset: 32)
!11 = !DIDerivedType(tag: DW_TAG_member, name: "c", scope: !6, file: !3, line: 4, baseType: !9, size: 1, offset: 64)
!12 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !6, file: !3, line: 5, baseType: !9, size: 28, offset: 65)
!13 = !{i32 2, !"Dwarf Version", i32 2}
!14 = !{i32 2, !"Debug Info Version", i32 3}
!15 = !{i32 1, !"PIC Level", i32 2}
!16 = !{!"clang version 3.7.0 (trunk 240548) (llvm/trunk 240554)"}

View File

@@ -1,111 +0,0 @@
; struct A {
; A();
; virtual ~A();
; };
; struct B : A {
; B();
; virtual ~B();
; };
; B::B() {}
; CHECK: __ZN1BC1Ev:
; CHECK: .loc 1 [[@LINE-2]] 0 prologue_end
; CHECK-NOT: .loc 1 0 0 prologue_end
; The location of the prologue_end marker should not be affected by the presence
; of CFI instructions.
; RUN: llc -O0 -filetype=asm < %s | FileCheck %s
; ModuleID = 'test1.cpp'
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-apple-ios"
%struct.B = type { %struct.A }
%struct.A = type { i32 (...)** }
@_ZTV1B = external unnamed_addr constant [4 x i8*]
; Function Attrs: nounwind
define %struct.B* @_ZN1BC2Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !28 {
entry:
tail call void @llvm.dbg.value(metadata %struct.B* %this, metadata !30, metadata !38), !dbg !39
%0 = getelementptr inbounds %struct.B, %struct.B* %this, i64 0, i32 0, !dbg !40
%call = tail call %struct.A* @_ZN1AC2Ev(%struct.A* %0) #3, !dbg !40
%1 = getelementptr inbounds %struct.B, %struct.B* %this, i64 0, i32 0, i32 0, !dbg !40
store i32 (...)** bitcast (i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %1, align 8, !dbg !40, !tbaa !41
ret %struct.B* %this, !dbg !40
}
declare %struct.A* @_ZN1AC2Ev(%struct.A*)
; Function Attrs: nounwind
define %struct.B* @_ZN1BC1Ev(%struct.B* %this) unnamed_addr #0 align 2 !dbg !32 {
entry:
tail call void @llvm.dbg.value(metadata %struct.B* %this, metadata !34, metadata !38), !dbg !44
tail call void @llvm.dbg.value(metadata %struct.B* %this, metadata !45, metadata !38) #3, !dbg !47
%0 = getelementptr inbounds %struct.B, %struct.B* %this, i64 0, i32 0, !dbg !48
%call.i = tail call %struct.A* @_ZN1AC2Ev(%struct.A* %0) #3, !dbg !48
%1 = getelementptr inbounds %struct.B, %struct.B* %this, i64 0, i32 0, i32 0, !dbg !48
store i32 (...)** bitcast (i8** getelementptr inbounds ([4 x i8*], [4 x i8*]* @_ZTV1B, i64 0, i64 2) to i32 (...)**), i32 (...)*** %1, align 8, !dbg !48, !tbaa !41
ret %struct.B* %this, !dbg !46
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
attributes #0 = { nounwind }
attributes #2 = { nounwind readnone }
attributes #3 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!35, !36}
!llvm.ident = !{!37}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !3, globals: !2, imports: !2)
!1 = !DIFile(filename: "<stdin>", directory: "")
!2 = !{}
!3 = !{!4, !13}
!4 = !DICompositeType(tag: DW_TAG_structure_type, name: "B", line: 5, size: 64, align: 64, file: !5, elements: !6, vtableHolder: !13, identifier: "_ZTS1B")
!5 = !DIFile(filename: "test1.cpp", directory: "")
!6 = !{!7, !8, !12}
!7 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !4, baseType: !13)
!8 = !DISubprogram(name: "B", line: 6, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 6, file: !5, scope: !4, type: !9)
!9 = !DISubroutineType(types: !10)
!10 = !{null, !11}
!11 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !4)
!12 = !DISubprogram(name: "~B", line: 7, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 7, file: !5, scope: !4, type: !9, containingType: !4)
!13 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, size: 64, align: 64, file: !5, elements: !14, vtableHolder: !13, identifier: "_ZTS1A")
!14 = !{!15, !22, !26}
!15 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$A", size: 64, flags: DIFlagArtificial, file: !5, scope: !16, baseType: !17)
!16 = !DIFile(filename: "test1.cpp", directory: "")
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, baseType: !18)
!18 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", size: 64, baseType: !19)
!19 = !DISubroutineType(types: !20)
!20 = !{!21}
!21 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!22 = !DISubprogram(name: "A", line: 2, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 2, file: !5, scope: !13, type: !23)
!23 = !DISubroutineType(types: !24)
!24 = !{null, !25}
!25 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !13)
!26 = !DISubprogram(name: "~A", line: 3, isLocal: false, isDefinition: false, virtuality: DW_VIRTUALITY_virtual, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 3, file: !5, scope: !13, type: !23, containingType: !13)
!28 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC2Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 9, file: !5, scope: !4, type: !9, declaration: !8, variables: !29)
!29 = !{!30}
!30 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31)
!31 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !4)
!32 = distinct !DISubprogram(name: "B", linkageName: "_ZN1BC1Ev", line: 9, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 9, file: !5, scope: !4, type: !9, declaration: !8, variables: !33)
!33 = !{!34}
!34 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !32, type: !31)
!35 = !{i32 2, !"Dwarf Version", i32 4}
!36 = !{i32 2, !"Debug Info Version", i32 3}
!37 = !{!"clang version 3.6.0 (trunk 224279) (llvm/trunk 224283)"}
!38 = !DIExpression()
!39 = !DILocation(line: 0, scope: !28)
!40 = !DILocation(line: 9, scope: !28)
!41 = !{!42, !42, i64 0}
!42 = !{!"vtable pointer", !43, i64 0}
!43 = !{!"Simple C/C++ TBAA"}
!44 = !DILocation(line: 0, scope: !32)
!45 = !DILocalVariable(name: "this", arg: 1, flags: DIFlagArtificial | DIFlagObjectPointer, scope: !28, type: !31)
!46 = !DILocation(line: 9, scope: !32)
!47 = !DILocation(line: 0, scope: !28, inlinedAt: !46)
!48 = !DILocation(line: 9, scope: !28, inlinedAt: !46)

View File

@@ -1,63 +0,0 @@
; RUN: llc -filetype=obj %s -o - | llvm-dwarfdump - | FileCheck %s
;
; Generated at -Os from:
; void *foo(void *dst);
; void start() {
; unsigned size;
; foo(&size);
; if (size != 0) { // Work around a bug to preserve the dbg.value.
; }
; }
; ModuleID = 'test1.cpp'
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios"
; Function Attrs: nounwind optsize
define void @_Z5startv() #0 !dbg !4 {
entry:
%size = alloca i32, align 4
%0 = bitcast i32* %size to i8*, !dbg !15
%call = call i8* @_Z3fooPv(i8* %0) #3, !dbg !15
call void @llvm.dbg.value(metadata i32* %size, metadata !10, metadata !16), !dbg !17
; CHECK: .debug_info contents:
; CHECK: DW_TAG_variable
; CHECK-NEXT: DW_AT_location
; CHECK-NEXT: DW_OP_breg31 WSP+12, DW_OP_deref
; CHECK-NEXT: DW_AT_name {{.*}}"size"
ret void, !dbg !18
}
; Function Attrs: optsize
declare i8* @_Z3fooPv(i8*) #1
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
attributes #0 = { nounwind optsize }
attributes #1 = { optsize }
attributes #2 = { nounwind readnone }
attributes #3 = { nounwind optsize }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!12, !13}
!llvm.ident = !{!14}
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.6.0 (trunk 223149) (llvm/trunk 223115)", isOptimized: true, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
!1 = !DIFile(filename: "<stdin>", directory: "")
!2 = !{}
!4 = distinct !DISubprogram(name: "start", linkageName: "_Z5startv", line: 2, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, unit: !0, scopeLine: 3, file: !5, scope: !6, type: !7, variables: !9)
!5 = !DIFile(filename: "test1.c", directory: "")
!6 = !DIFile(filename: "test1.c", directory: "")
!7 = !DISubroutineType(types: !8)
!8 = !{null}
!9 = !{!10}
!10 = !DILocalVariable(name: "size", line: 4, scope: !4, file: !6, type: !11)
!11 = !DIBasicType(tag: DW_TAG_base_type, name: "unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned)
!12 = !{i32 2, !"Dwarf Version", i32 2}
!13 = !{i32 2, !"Debug Info Version", i32 3}
!14 = !{!"clang version 3.6.0 (trunk 223149) (llvm/trunk 223115)"}
!15 = !DILocation(line: 5, column: 3, scope: !4)
!16 = !DIExpression(DW_OP_deref)
!17 = !DILocation(line: 4, column: 12, scope: !4)
!18 = !DILocation(line: 8, column: 1, scope: !4)

View File

@@ -1,36 +0,0 @@
; RUN: llc -filetype=asm %s -o - | FileCheck %s
target datalayout = "e-m:e-p:32:32-i64:64-v128:64:128-a:0:32-n32-S64"
target triple = "aarch64--linux-gnueabihf"
; int
; main(void)
; {
; return -1;
; }
; CHECK: test.c:4:5
; CHECK: mov
; Function Attrs: nounwind
define i32 @main() !dbg !4 {
entry:
%retval = alloca i32, align 4
store i32 0, i32* %retval
ret i32 -1, !dbg !11
}
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!8, !9}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, emissionKind: FullDebug)
!1 = !DIFile(filename: "test.c", directory: "/home/user/clang/build")
!2 = !{}
!4 = distinct !DISubprogram(name: "main", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{!7}
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !{i32 2, !"Dwarf Version", i32 4}
!9 = !{i32 2, !"Debug Info Version", i32 3}
!10 = !{i32 1, !"wchar_size", i32 4}
!11 = !DILocation(line: 4, column: 5, scope: !4)

View File

@@ -1,64 +0,0 @@
; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump --name cntrl_flags - | FileCheck %s
; CHECK: DW_OP_reg0 W0
;
; void use(unsigned char);
; f(unsigned long long cntrl_flags,
; int page_count)
; {
; unsigned char tag;
; tag = (((cntrl_flags) >> 32) & 0xFF);
; use(tag);
; }
source_filename = "test.i"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios5.0.0"
; Function Attrs: nounwind ssp uwtable
define i32 @f(i64 %cntrl_flags) local_unnamed_addr #0 !dbg !8 {
entry:
tail call void @llvm.dbg.value(metadata i64 %cntrl_flags, metadata !14, metadata !DIExpression()), !dbg !18
%shr = lshr i64 %cntrl_flags, 32, !dbg !20
%conv = trunc i64 %shr to i8, !dbg !21
tail call void @llvm.dbg.value(metadata i8 %conv, metadata !16, metadata !DIExpression()), !dbg !22
tail call void @use(i8 zeroext %conv) #3, !dbg !23
ret i32 undef, !dbg !24
}
declare void @use(i8 zeroext) local_unnamed_addr
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #2
attributes #0 = { nounwind ssp uwtable }
attributes #2 = { nounwind readnone speculatable }
attributes #3 = { nobuiltin nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5, !6}
!llvm.ident = !{!7}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 (trunk 317700) (llvm/trunk 317708)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "test.i", directory: "/")
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 2}
!4 = !{i32 2, !"Debug Info Version", i32 3}
!5 = !{i32 1, !"wchar_size", i32 4}
!6 = !{i32 7, !"PIC Level", i32 2}
!7 = !{!"clang version 6.0.0 (trunk 317700) (llvm/trunk 317708)"}
!8 = distinct !DISubprogram(name: "f", scope: !1, file: !1, line: 2, type: !9, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: true, unit: !0, variables: !13)
!9 = !DISubroutineType(types: !10)
!10 = !{!11, !11}
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !DIBasicType(name: "long long unsigned int", size: 64, encoding: DW_ATE_unsigned)
!13 = !{!14, !16}
!14 = !DILocalVariable(name: "cntrl_flags", arg: 1, scope: !8, file: !1, line: 2, type: !12)
!16 = !DILocalVariable(name: "tag", scope: !8, file: !1, line: 5, type: !17)
!17 = !DIBasicType(name: "unsigned char", size: 8, encoding: DW_ATE_unsigned_char)
!18 = !DILocation(line: 2, column: 22, scope: !8)
!19 = !DILocation(line: 3, column: 31, scope: !8)
!20 = !DILocation(line: 6, column: 24, scope: !8)
!21 = !DILocation(line: 6, column: 8, scope: !8)
!22 = !DILocation(line: 5, column: 16, scope: !8)
!23 = !DILocation(line: 7, column: 2, scope: !8)
!24 = !DILocation(line: 8, column: 1, scope: !8)

View File

@@ -1,39 +0,0 @@
; RUN: llc -mtriple=aarch64-non-linux-gnu -dwarf-version=4 < %s -filetype=obj \
; RUN: | llvm-dwarfdump -v - | FileCheck -check-prefix=CHECK -check-prefix=CHECK-4 %s
; RUN: llc -mtriple=aarch64-non-linux-gnu -dwarf-version=3 < %s -filetype=obj \
; RUN: | llvm-dwarfdump -v - | FileCheck -check-prefix=CHECK -check-prefix=CHECK-3 %s
; We're mostly checking that relocations are applied correctly
; here. Currently R_AARCH64_ABS32 is used for references to debug data
; and R_AARCH64_ABS64 is used for program addresses.
; A couple of ABS32s, both at 0 and elsewhere, interpreted correctly:
; CHECK: DW_AT_producer [DW_FORM_strp] ( .debug_str[0x00000000] = "clang version 3.3 ")
; CHECK: DW_AT_name [DW_FORM_strp] ( .debug_str[0x00000013] = "tmp.c")
; A couple of ABS64s similarly:
; CHECK: DW_AT_low_pc [DW_FORM_addr] (0x0000000000000000)
; CHECK-4: DW_AT_high_pc [DW_FORM_data4] (0x00000008)
; CHECK-3: DW_AT_high_pc [DW_FORM_addr] (0x0000000000000008)
define i32 @main() nounwind !dbg !3 {
ret i32 0, !dbg !8
}
attributes #0 = { nounwind }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!10}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "clang version 3.3 ", isOptimized: false, emissionKind: FullDebug, file: !9, enums: !1, retainedTypes: !1, globals: !1, imports: !1)
!1 = !{}
!3 = distinct !DISubprogram(name: "main", line: 1, isLocal: false, isDefinition: true, virtualIndex: 6, isOptimized: false, unit: !0, scopeLine: 1, file: !9, scope: !4, type: !5, variables: !1)
!4 = !DIFile(filename: "tmp.c", directory: "/home/tim/llvm/build")
!5 = !DISubroutineType(types: !6)
!6 = !{!7}
!7 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = !DILocation(line: 2, scope: !3)
!9 = !DIFile(filename: "tmp.c", directory: "/home/tim/llvm/build")
!10 = !{i32 1, !"Debug Info Version", i32 3}

View File

@@ -1,48 +0,0 @@
// RUN: llvm-mc -triple aarch64-none-linux-gnu -filetype=obj %s -o %t
// RUN: llvm-objdump -s %t | FileCheck %s
.text
.globl foo
.type foo,@function
foo:
.cfi_startproc
ret
.cfi_endproc
// The really key points we're checking here are:
// * Return register is x30.
// * Pointer format is 0x1b (GNU doesn't appear to understand others).
// The rest is largely incidental, but not expected to change regularly.
// Output is:
// CHECK: Contents of section .eh_frame:
// CHECK-NEXT: 0000 10000000 00000000 017a5200 017c1e01 .........zR..|..
// CHECK-NEXT: 0010 1b0c1f00 10000000 18000000 00000000 ................
// Won't check the rest, it's rather incidental.
// 0020 04000000 00000000 ........
// The first CIE:
// -------------------
// 10000000: length of first CIE = 0x10
// 00000000: This is a CIE
// 03: version = 0x3
// 7a 52 00: augmentation string "zR" -- pointer format is specified
// 01: code alignment factor 1
// 7c: data alignment factor -4
// 1e: return address register 30 (== x30).
// 01: 1 byte of augmentation
// 1b: pointer format 1b: DW_EH_PE_pcrel | DW_EH_PE_sdata4
// 0c 1f 00: initial instructions: "DW_CFA_def_cfa x31 ofs 0" in this case
// Next the FDE:
// -------------
// 10000000: FDE length 0x10
// 18000000: Uses CIE 0x18 backwards (only coincidentally same as above)
// 00000000: PC begin for this FDE is at 00000000 (relocation is applied here)
// 04000000: FDE applies up to PC begin+0x14
// 00: Augmentation string length 0 for this FDE

View File

@@ -1,46 +0,0 @@
; RUN: llc -verify-machineinstrs -mtriple=aarch64-none-linux-gnu %s -filetype=obj -o %t
; RUN: llvm-objdump -s %t | FileCheck %s
declare i32 @__gxx_personality_v0(...)
declare void @bar()
define i64 @foo(i64 %lhs, i64 %rhs) personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) {
invoke void @bar() to label %end unwind label %clean
end:
ret i64 0
clean:
%tst = landingpad { i8*, i32 } cleanup
ret i64 42
}
; CHECK: Contents of section .eh_frame:
; CHECK: 0000 1c000000 00000000 017a504c 5200017c .........zPLR..|
; CHECK: 0010 1e0b0000 00000000 00000000 1b0c1f00 ................
; Don't really care about the rest:
; 0020 1c000000 24000000 00000000 24000000 ....$.......$...
; 0030 08000000 00000000 00440c1f 10449e02 .........D...D..
; The key test here is that the personality routine is sanely encoded (under the
; small memory model it must be an 8-byte value for full generality: code+data <
; 4GB, but you might need both +4GB and -4GB depending on where things end
; up. However, for completeness:
; First CIE:
; ----------
; 1c000000: Length = 0x1c
; 00000000: This is a CIE
; 03: Version 3
; 7a 50 4c 52 00: Augmentation string "zPLR" (personality routine, language-specific data, pointer format)
; 01: Code alignment factor 1
; 78: Data alignment factor: -8
; 1e: Return address in x30
; 07: Augmentation data 0xb bytes (this is key!)
; 00: Personality encoding is DW_EH_PE_absptr
; 00 00 00 00 00 00 00 00: First part of aug (personality routine). Relocated, obviously
; 00: Second part of aug (language-specific data): absolute pointer format used
; 1b: pointer format: pc-relative signed 4-byte. Just like GNU.
; 0c 1f 00: Initial instructions ("DW_CFA_def_cfa x31 ofs 0" in this case)

View File

@@ -1,256 +0,0 @@
; RUN: llc -disable-fp-elim -O0 -fast-isel -filetype=obj < %s | llvm-dwarfdump -v - | FileCheck %s
; Test that a variable with multiple entries in the MMI table makes it into the
; debug info.
;
; CHECK: DW_TAG_inlined_subroutine
; CHECK: "_Z3f111A"
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_AT_location [DW_FORM_block1] (DW_OP_piece 0x1, DW_OP_fbreg -47, DW_OP_piece 0xf, DW_OP_piece 0x1, DW_OP_fbreg -54, DW_OP_piece 0x7)
; CHECK: DW_AT_abstract_origin {{.*}} "p1"
;
; long a;
; struct A {
; bool x4;
; void *x5;
; bool x6;
; };
; int *b;
; struct B {
; B(long);
; ~B();
; };
; void f9(A);
; void f13(A p1) {
; b = (int *)__builtin_operator_new(a);
; f9(p1);
; }
; void f11(A p1) { f13(p1); }
; void f16() {
; A c;
; B d(a);
; c.x6 = c.x4 = true;
; f11(c);
; }
; ModuleID = 'test.cpp'
source_filename = "test/DebugInfo/AArch64/frameindices.ll"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-apple-ios"
%struct.A = type { i8, i8*, i8 }
%struct.B = type { i8 }
@a = global i64 0, align 8, !dbg !0
@b = global i32* null, align 8, !dbg !4
define void @_Z3f131A(%struct.A* nocapture readonly %p1) !dbg !32 {
entry:
%agg.tmp = alloca %struct.A, align 8
tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !36, metadata !37), !dbg !38
%0 = load i64, i64* @a, align 8, !dbg !39, !tbaa !40
%call = tail call noalias i8* @_Znwm(i64 %0) #4, !dbg !44
store i8* %call, i8** bitcast (i32** @b to i8**), align 8, !dbg !45, !tbaa !46
%1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp, i64 0, i32 0, !dbg !48
%2 = getelementptr inbounds %struct.A, %struct.A* %p1, i64 0, i32 0, !dbg !48
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 8, i1 false), !dbg !48, !tbaa.struct !49
call void @_Z2f91A(%struct.A* %agg.tmp), !dbg !52
ret void, !dbg !53
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
; Function Attrs: nobuiltin
declare noalias i8* @_Znwm(i64) #1
declare void @_Z2f91A(%struct.A*)
; Function Attrs: argmemonly nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i32, i1) #2
define void @_Z3f111A(%struct.A* nocapture readonly %p1) !dbg !54 {
entry:
%agg.tmp.i = alloca %struct.A, align 8
tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !56, metadata !37), !dbg !57
%0 = getelementptr inbounds %struct.A, %struct.A* %p1, i64 0, i32 0, !dbg !58
%1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i, i64 0, i32 0, !dbg !59
call void @llvm.lifetime.start(i64 24, i8* %1), !dbg !59
%2 = load i64, i64* @a, align 8, !dbg !61, !tbaa !40
%call.i = tail call noalias i8* @_Znwm(i64 %2) #4, !dbg !62
store i8* %call.i, i8** bitcast (i32** @b to i8**), align 8, !dbg !63, !tbaa !46
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %0, i64 24, i32 8, i1 false), !dbg !64
call void @_Z2f91A(%struct.A* %agg.tmp.i), !dbg !65
call void @llvm.lifetime.end(i64 24, i8* %1), !dbg !66
ret void, !dbg !67
}
define void @_Z3f16v() personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*) !dbg !68 {
entry:
%agg.tmp.i.i = alloca %struct.A, align 8
%d = alloca %struct.B, align 1
%agg.tmp.sroa.2 = alloca [15 x i8], align 1
%agg.tmp.sroa.4 = alloca [7 x i8], align 1
tail call void @llvm.dbg.declare(metadata [15 x i8]* %agg.tmp.sroa.2, metadata !56, metadata !74), !dbg !75
tail call void @llvm.dbg.declare(metadata [7 x i8]* %agg.tmp.sroa.4, metadata !56, metadata !77), !dbg !75
tail call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !72, metadata !37), !dbg !78
%0 = load i64, i64* @a, align 8, !dbg !79, !tbaa !40
tail call void @llvm.dbg.value(metadata %struct.B* %d, metadata !73, metadata !37), !dbg !80
%call = call %struct.B* @_ZN1BC1El(%struct.B* %d, i64 %0), !dbg !80
call void @llvm.dbg.value(metadata i8 1, metadata !72, metadata !81), !dbg !78
call void @llvm.dbg.value(metadata i8 1, metadata !72, metadata !82), !dbg !78
call void @llvm.dbg.value(metadata i8 1, metadata !56, metadata !81), !dbg !75
call void @llvm.dbg.value(metadata i8 1, metadata !56, metadata !82), !dbg !75
call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !56, metadata !37), !dbg !75
%1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i.i, i64 0, i32 0, !dbg !83
call void @llvm.lifetime.start(i64 24, i8* %1), !dbg !83
%2 = load i64, i64* @a, align 8, !dbg !85, !tbaa !40
%call.i.i5 = invoke noalias i8* @_Znwm(i64 %2) #4
to label %call.i.i.noexc unwind label %lpad, !dbg !86
call.i.i.noexc: ; preds = %entry
%agg.tmp.sroa.4.17..sroa_idx = getelementptr inbounds [7 x i8], [7 x i8]* %agg.tmp.sroa.4, i64 0, i64 0, !dbg !87
%agg.tmp.sroa.2.1..sroa_idx = getelementptr inbounds [15 x i8], [15 x i8]* %agg.tmp.sroa.2, i64 0, i64 0, !dbg !87
store i8* %call.i.i5, i8** bitcast (i32** @b to i8**), align 8, !dbg !88, !tbaa !46
store i8 1, i8* %1, align 8, !dbg !89
%agg.tmp.sroa.2.0..sroa_raw_idx = getelementptr inbounds i8, i8* %1, i64 1, !dbg !89
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.2.0..sroa_raw_idx, i8* %agg.tmp.sroa.2.1..sroa_idx, i64 15, i32 1, i1 false), !dbg !89
%agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i.i, i64 0, i32 2, !dbg !89
store i8 1, i8* %agg.tmp.sroa.3.0..sroa_idx, align 8, !dbg !89
%agg.tmp.sroa.4.0..sroa_raw_idx = getelementptr inbounds i8, i8* %1, i64 17, !dbg !89
call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.4.0..sroa_raw_idx, i8* %agg.tmp.sroa.4.17..sroa_idx, i64 7, i32 1, i1 false), !dbg !89
invoke void @_Z2f91A(%struct.A* %agg.tmp.i.i)
to label %invoke.cont unwind label %lpad, !dbg !90
invoke.cont: ; preds = %call.i.i.noexc
call void @llvm.lifetime.end(i64 24, i8* %1), !dbg !91
call void @llvm.dbg.value(metadata %struct.B* %d, metadata !73, metadata !37), !dbg !80
%call1 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !92
ret void, !dbg !92
lpad: ; preds = %call.i.i.noexc, %entry
%3 = landingpad { i8*, i32 }
cleanup, !dbg !92
call void @llvm.dbg.value(metadata %struct.B* %d, metadata !73, metadata !37), !dbg !80
%call2 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !92
resume { i8*, i32 } %3, !dbg !92
}
declare %struct.B* @_ZN1BC1El(%struct.B*, i64)
declare i32 @__gxx_personality_v0(...)
; Function Attrs: nounwind
declare %struct.B* @_ZN1BD1Ev(%struct.B*) #3
; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, metadata, metadata) #0
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.start(i64, i8* nocapture) #2
; Function Attrs: argmemonly nounwind
declare void @llvm.lifetime.end(i64, i8* nocapture) #2
attributes #0 = { nounwind readnone }
attributes #1 = { nobuiltin }
attributes #2 = { argmemonly nounwind }
attributes #3 = { nounwind }
attributes #4 = { builtin }
!llvm.dbg.cu = !{!8}
!llvm.module.flags = !{!29, !30}
!llvm.ident = !{!31}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = !DIGlobalVariable(name: "a", scope: null, file: !2, line: 1, type: !3, isLocal: false, isDefinition: true)
!2 = !DIFile(filename: "test.cpp", directory: "")
!3 = !DIBasicType(name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
!4 = !DIGlobalVariableExpression(var: !5, expr: !DIExpression())
!5 = !DIGlobalVariable(name: "b", scope: null, file: !2, line: 7, type: !6, isLocal: false, isDefinition: true)
!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64, align: 64)
!7 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!8 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !9, producer: "clang version 3.7.0 ", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !10, retainedTypes: !11, globals: !28, imports: !10)
!9 = !DIFile(filename: "<stdin>", directory: "")
!10 = !{}
!11 = !{!12, !6, !19}
!12 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !2, line: 2, size: 192, align: 64, elements: !13, identifier: "_ZTS1A")
!13 = !{!14, !16, !18}
!14 = !DIDerivedType(tag: DW_TAG_member, name: "x4", scope: !12, file: !2, line: 3, baseType: !15, size: 8, align: 8)
!15 = !DIBasicType(name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)
!16 = !DIDerivedType(tag: DW_TAG_member, name: "x5", scope: !12, file: !2, line: 4, baseType: !17, size: 64, align: 64, offset: 64)
!17 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64, align: 64)
!18 = !DIDerivedType(tag: DW_TAG_member, name: "x6", scope: !12, file: !2, line: 5, baseType: !15, size: 8, align: 8, offset: 128)
!19 = !DICompositeType(tag: DW_TAG_structure_type, name: "B", file: !2, line: 8, size: 8, align: 8, elements: !20, identifier: "_ZTS1B")
!20 = !{!21, !25}
!21 = !DISubprogram(name: "B", scope: !19, file: !2, line: 9, type: !22, isLocal: false, isDefinition: false, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true)
!22 = !DISubroutineType(types: !23)
!23 = !{null, !24, !3}
!24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
!25 = !DISubprogram(name: "~B", scope: !19, file: !2, line: 10, type: !26, isLocal: false, isDefinition: false, scopeLine: 10, flags: DIFlagPrototyped, isOptimized: true)
!26 = !DISubroutineType(types: !27)
!27 = !{null, !24}
!28 = !{!0, !4}
!29 = !{i32 2, !"Dwarf Version", i32 2}
!30 = !{i32 2, !"Debug Info Version", i32 3}
!31 = !{!"clang version 3.7.0 "}
!32 = distinct !DISubprogram(name: "f13", linkageName: "_Z3f131A", scope: !2, file: !2, line: 13, type: !33, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: true, unit: !8, variables: !35)
!33 = !DISubroutineType(types: !34)
!34 = !{null, !12}
!35 = !{!36}
!36 = !DILocalVariable(name: "p1", arg: 1, scope: !32, file: !2, line: 13, type: !12)
!37 = !DIExpression(DW_OP_deref)
!38 = !DILocation(line: 13, column: 12, scope: !32)
!39 = !DILocation(line: 14, column: 37, scope: !32)
!40 = !{!41, !41, i64 0}
!41 = !{!"long", !42, i64 0}
!42 = !{!"omnipotent char", !43, i64 0}
!43 = !{!"Simple C/C++ TBAA"}
!44 = !DILocation(line: 14, column: 14, scope: !32)
!45 = !DILocation(line: 14, column: 5, scope: !32)
!46 = !{!47, !47, i64 0}
!47 = !{!"any pointer", !42, i64 0}
!48 = !DILocation(line: 15, column: 6, scope: !32)
!49 = !{i64 0, i64 1, !50, i64 8, i64 8, !46, i64 16, i64 1, !50}
!50 = !{!51, !51, i64 0}
!51 = !{!"bool", !42, i64 0}
!52 = !DILocation(line: 15, column: 3, scope: !32)
!53 = !DILocation(line: 16, column: 1, scope: !32)
!54 = distinct !DISubprogram(name: "f11", linkageName: "_Z3f111A", scope: !2, file: !2, line: 17, type: !33, isLocal: false, isDefinition: true, scopeLine: 17, flags: DIFlagPrototyped, isOptimized: true, unit: !8, variables: !55)
!55 = !{!56}
!56 = !DILocalVariable(name: "p1", arg: 1, scope: !54, file: !2, line: 17, type: !12)
!57 = !DILocation(line: 17, column: 12, scope: !54)
!58 = !DILocation(line: 17, column: 22, scope: !54)
!59 = !DILocation(line: 13, column: 12, scope: !32, inlinedAt: !60)
!60 = distinct !DILocation(line: 17, column: 18, scope: !54)
!61 = !DILocation(line: 14, column: 37, scope: !32, inlinedAt: !60)
!62 = !DILocation(line: 14, column: 14, scope: !32, inlinedAt: !60)
!63 = !DILocation(line: 14, column: 5, scope: !32, inlinedAt: !60)
!64 = !DILocation(line: 15, column: 6, scope: !32, inlinedAt: !60)
!65 = !DILocation(line: 15, column: 3, scope: !32, inlinedAt: !60)
!66 = !DILocation(line: 16, column: 1, scope: !32, inlinedAt: !60)
!67 = !DILocation(line: 17, column: 27, scope: !54)
!68 = distinct !DISubprogram(name: "f16", linkageName: "_Z3f16v", scope: !2, file: !2, line: 18, type: !69, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: true, unit: !8, variables: !71)
!69 = !DISubroutineType(types: !70)
!70 = !{null}
!71 = !{!72, !73}
!72 = !DILocalVariable(name: "c", scope: !68, file: !2, line: 19, type: !12)
!73 = !DILocalVariable(name: "d", scope: !68, file: !2, line: 20, type: !19)
!74 = !DIExpression(DW_OP_LLVM_fragment, 8, 120)
!75 = !DILocation(line: 17, column: 12, scope: !54, inlinedAt: !76)
!76 = distinct !DILocation(line: 22, column: 3, scope: !68)
!77 = !DIExpression(DW_OP_LLVM_fragment, 136, 56)
!78 = !DILocation(line: 19, column: 5, scope: !68)
!79 = !DILocation(line: 20, column: 7, scope: !68)
!80 = !DILocation(line: 20, column: 5, scope: !68)
!81 = !DIExpression(DW_OP_LLVM_fragment, 0, 8)
!82 = !DIExpression(DW_OP_LLVM_fragment, 128, 8)
!83 = !DILocation(line: 13, column: 12, scope: !32, inlinedAt: !84)
!84 = distinct !DILocation(line: 17, column: 18, scope: !54, inlinedAt: !76)
!85 = !DILocation(line: 14, column: 37, scope: !32, inlinedAt: !84)
!86 = !DILocation(line: 14, column: 14, scope: !32, inlinedAt: !84)
!87 = !DILocation(line: 22, column: 7, scope: !68)
!88 = !DILocation(line: 14, column: 5, scope: !32, inlinedAt: !84)
!89 = !DILocation(line: 15, column: 6, scope: !32, inlinedAt: !84)
!90 = !DILocation(line: 15, column: 3, scope: !32, inlinedAt: !84)
!91 = !DILocation(line: 16, column: 1, scope: !32, inlinedAt: !84)
!92 = !DILocation(line: 23, column: 1, scope: !68)

View File

@@ -1,140 +0,0 @@
; RUN: llc -filetype=obj -o - %s | llvm-dwarfdump --name resource - | FileCheck %s
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_TAG_formal_parameter
; CHECK-NEXT: DW_AT_location (DW_OP_reg1 W1)
; CHECK-NEXT: DW_AT_abstract_origin {{.*}}"resource"
;
; Generated from:
; typedef struct t *t_t;
; extern unsigned int enable;
; struct t {
; struct q {
; struct q *next;
; unsigned long long resource;
; } * s;
; } * tt;
; static unsigned long find(t_t t, unsigned long long resource) {
; struct q *q;
; q = t->s;
; while (q) {
; if (q->resource == resource)
; return q;
; q = q->next;
; }
; }
; int g(t_t t, unsigned long long r) {
; struct q *q;
; q = find(t, r);
; if (!q)
; if (__builtin_expect(enable, 0)) { }
; }
source_filename = "test.i"
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "arm64-apple-ios5.0.0"
%struct.t = type { %struct.q* }
%struct.q = type { %struct.q*, i64 }
@tt = local_unnamed_addr global %struct.t* null, align 8, !dbg !0
; Function Attrs: noredzone nounwind readonly ssp
define i32 @g(%struct.t* nocapture readonly %t, i64 %r) local_unnamed_addr #0 !dbg !20 {
entry:
tail call void @llvm.dbg.value(metadata %struct.t* %t, metadata !26, metadata !DIExpression()), !dbg !29
tail call void @llvm.dbg.value(metadata i64 %r, metadata !27, metadata !DIExpression()), !dbg !30
tail call void @llvm.dbg.value(metadata %struct.t* %t, metadata !31, metadata !DIExpression()), !dbg !39
tail call void @llvm.dbg.value(metadata i64 %r, metadata !37, metadata !DIExpression()), !dbg !41
%s.i5 = bitcast %struct.t* %t to %struct.q**
tail call void @llvm.dbg.value(metadata %struct.q** %s.i5, metadata !38, metadata !DIExpression(DW_OP_deref)), !dbg !42
%q.06.i = load %struct.q*, %struct.q** %s.i5, align 8
tail call void @llvm.dbg.value(metadata %struct.q* %q.06.i, metadata !38, metadata !DIExpression()), !dbg !42
%tobool7.i = icmp eq %struct.q* %q.06.i, null, !dbg !43
br i1 %tobool7.i, label %find.exit, label %while.body.i.preheader, !dbg !43
while.body.i.preheader: ; preds = %entry
br label %while.body.i, !dbg !44
while.body.i: ; preds = %while.body.i.preheader, %if.end.i
%q.08.i = phi %struct.q* [ %q.0.i, %if.end.i ], [ %q.06.i, %while.body.i.preheader ]
%resource1.i = getelementptr inbounds %struct.q, %struct.q* %q.08.i, i64 0, i32 1, !dbg !44
%0 = load i64, i64* %resource1.i, align 8, !dbg !44
%cmp.i = icmp eq i64 %0, %r, !dbg !47
br i1 %cmp.i, label %find.exit, label %if.end.i, !dbg !48
if.end.i: ; preds = %while.body.i
%next.i6 = bitcast %struct.q* %q.08.i to %struct.q**
tail call void @llvm.dbg.value(metadata %struct.q** %next.i6, metadata !38, metadata !DIExpression(DW_OP_deref)), !dbg !42
%q.0.i = load %struct.q*, %struct.q** %next.i6, align 8
tail call void @llvm.dbg.value(metadata %struct.q* %q.0.i, metadata !38, metadata !DIExpression()), !dbg !42
%tobool.i = icmp eq %struct.q* %q.0.i, null, !dbg !43
br i1 %tobool.i, label %find.exit, label %while.body.i, !dbg !43, !llvm.loop !49
find.exit: ; preds = %while.body.i, %if.end.i, %entry
ret i32 undef, !dbg !52
}
; Function Attrs: nounwind readnone speculatable
declare void @llvm.dbg.value(metadata, metadata, metadata) #1
attributes #0 = { noredzone nounwind readonly ssp }
attributes #1 = { nounwind readnone speculatable }
!llvm.dbg.cu = !{!2}
!llvm.module.flags = !{!16, !17, !18}
!llvm.ident = !{!19}
!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
!1 = distinct !DIGlobalVariable(name: "tt", scope: !2, file: !3, line: 8, type: !6, isLocal: false, isDefinition: true)
!2 = distinct !DICompileUnit(language: DW_LANG_C99, file: !3, producer: "clang version 6.0.0 (trunk 317516) (llvm/trunk 317518)", isOptimized: true, runtimeVersion: 0, emissionKind: FullDebug, enums: !4, globals: !5)
!3 = !DIFile(filename: "test.i", directory: "/")
!4 = !{}
!5 = !{!0}
!6 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !7, size: 64)
!7 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "t", file: !3, line: 3, size: 64, elements: !8)
!8 = !{!9}
!9 = !DIDerivedType(tag: DW_TAG_member, name: "s", scope: !7, file: !3, line: 7, baseType: !10, size: 64)
!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64)
!11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "q", file: !3, line: 4, size: 128, elements: !12)
!12 = !{!13, !14}
!13 = !DIDerivedType(tag: DW_TAG_member, name: "next", scope: !11, file: !3, line: 5, baseType: !10, size: 64)
!14 = !DIDerivedType(tag: DW_TAG_member, name: "resource", scope: !11, file: !3, line: 6, baseType: !15, size: 64, offset: 64)
!15 = !DIBasicType(name: "long long unsigned int", size: 64, encoding: DW_ATE_unsigned)
!16 = !{i32 2, !"Dwarf Version", i32 2}
!17 = !{i32 2, !"Debug Info Version", i32 3}
!18 = !{i32 1, !"wchar_size", i32 4}
!19 = !{!"clang version 6.0.0 (trunk 317516) (llvm/trunk 317518)"}
!20 = distinct !DISubprogram(name: "g", scope: !3, file: !3, line: 18, type: !21, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !25)
!21 = !DISubroutineType(types: !22)
!22 = !{!23, !24, !15}
!23 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!24 = !DIDerivedType(tag: DW_TAG_typedef, name: "t_t", file: !3, line: 1, baseType: !6)
!25 = !{!26, !27, !28}
!26 = !DILocalVariable(name: "t", arg: 1, scope: !20, file: !3, line: 18, type: !24)
!27 = !DILocalVariable(name: "r", arg: 2, scope: !20, file: !3, line: 18, type: !15)
!28 = !DILocalVariable(name: "q", scope: !20, file: !3, line: 19, type: !10)
!29 = !DILocation(line: 18, column: 11, scope: !20)
!30 = !DILocation(line: 18, column: 33, scope: !20)
!31 = !DILocalVariable(name: "t", arg: 1, scope: !32, file: !3, line: 9, type: !24)
!32 = distinct !DISubprogram(name: "find", scope: !3, file: !3, line: 9, type: !33, isLocal: true, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: true, unit: !2, variables: !36)
!33 = !DISubroutineType(types: !34)
!34 = !{!35, !24, !15}
!35 = !DIBasicType(name: "long unsigned int", size: 64, encoding: DW_ATE_unsigned)
!36 = !{!31, !37, !38}
!37 = !DILocalVariable(name: "resource", arg: 2, scope: !32, file: !3, line: 9, type: !15)
!38 = !DILocalVariable(name: "q", scope: !32, file: !3, line: 10, type: !10)
!39 = !DILocation(line: 9, column: 31, scope: !32, inlinedAt: !40)
!40 = distinct !DILocation(line: 20, column: 7, scope: !20)
!41 = !DILocation(line: 9, column: 53, scope: !32, inlinedAt: !40)
!42 = !DILocation(line: 10, column: 13, scope: !32, inlinedAt: !40)
!43 = !DILocation(line: 12, column: 3, scope: !32, inlinedAt: !40)
!44 = !DILocation(line: 13, column: 12, scope: !45, inlinedAt: !40)
!45 = distinct !DILexicalBlock(scope: !46, file: !3, line: 13, column: 9)
!46 = distinct !DILexicalBlock(scope: !32, file: !3, line: 12, column: 13)
!47 = !DILocation(line: 13, column: 21, scope: !45, inlinedAt: !40)
!48 = !DILocation(line: 13, column: 9, scope: !46, inlinedAt: !40)
!49 = distinct !{!49, !50, !51}
!50 = !DILocation(line: 12, column: 3, scope: !32)
!51 = !DILocation(line: 16, column: 3, scope: !32)
!52 = !DILocation(line: 24, column: 1, scope: !20)

View File

@@ -1,6 +0,0 @@
; RUN: llc -mtriple=aarch64-none-linux -O0 -fast-isel -filetype=obj - < %S/../Inputs/line.ll | llvm-dwarfdump -v - | FileCheck %s
; RUN: llc -mtriple=aarch64_be-none-linux -O0 -fast-isel -filetype=obj - < %S/../Inputs/line.ll | llvm-dwarfdump -v - | FileCheck %s
; check line table length is correctly calculated for both big and little endian
CHECK-LABEL: .debug_line contents:
CHECK: total_length: 0x0000003f

View File

@@ -1,3 +0,0 @@
if not 'AArch64' in config.root.targets:
config.unsupported = True

View File

@@ -1,16 +0,0 @@
; RUN: llc -O0 -filetype=obj -mtriple=aarch64-none-linux < %s | llvm-dwarfdump - | FileCheck %s
; CHECK: file format ELF64-aarch64-little
target datalayout = "e-m:e-i64:64-i128:128-n32:64-S128"
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
!0 = !{i32 786449, !1, i32 12, !"clang version 3.6.0 ", i1 false, !"", i32 0, !2, !2, !2, !2, !2, !"", i32 1} ; [ DW_TAG_compile_unit ] [/a/empty.c] [DW_LANG_C99]
!1 = !{!"empty.c", !"/a"}
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 1}
!5 = !{!"clang version 3.6.0 "}

View File

@@ -1,15 +0,0 @@
; RUN: llc -filetype=obj -O0 < %s -mtriple aarch64-unknown-linux | \
; RUN: llvm-dwarfdump - 2>&1 | FileCheck %s
; CHECK-NOT: failed to compute relocation
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4}
!llvm.ident = !{!5}
!0 = !{i32 786449, !1, i32 12, !"clang version 3.6.0 ", i1 false, !"", i32 0, !2, !2, !2, !2, !2, !"", i32 1} ; [ DW_TAG_compile_unit ] [/a/empty.c] [DW_LANG_C99]
!1 = !{!"empty.c", !"/a"}
!2 = !{}
!3 = !{i32 2, !"Dwarf Version", i32 4}
!4 = !{i32 2, !"Debug Info Version", i32 1}
!5 = !{!"clang version 3.6.0 "}

View File

@@ -1,42 +0,0 @@
; RUN: llc -disable-fp-elim -O0 -fast-isel %s -mtriple aarch64-apple-darwin -o - | FileCheck %s
; int func(void);
; void prologue_end_test() {
; func();
; func();
; }
define void @prologue_end_test() nounwind uwtable !dbg !4 {
; CHECK: prologue_end_test:
; CHECK: .cfi_startproc
; CHECK: sub sp, sp
; CHECK: stp x29, x30
; CHECK: add x29, sp
; CHECK: .loc 1 3 3 prologue_end
; CHECK: bl _func
; CHECK: bl _func
entry:
%call = call i32 @func(), !dbg !11
%call1 = call i32 @func(), !dbg !12
ret void, !dbg !13
}
declare i32 @func()
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!7, !8, !9}
!llvm.ident = !{!10}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 3.7.0 (trunk 242129)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "foo.c", directory: "/tmp")
!2 = !{}
!4 = distinct !DISubprogram(name: "prologue_end_test", scope: !1, file: !1, line: 2, type: !5, isLocal: false, isDefinition: true, scopeLine: 2, isOptimized: false, unit: !0, variables: !2)
!5 = !DISubroutineType(types: !6)
!6 = !{null}
!7 = !{i32 2, !"Dwarf Version", i32 2}
!8 = !{i32 2, !"Debug Info Version", i32 3}
!9 = !{i32 1, !"PIC Level", i32 2}
!10 = !{!"clang version 3.7.0 (trunk 242129)"}
!11 = !DILocation(line: 3, column: 3, scope: !4)
!12 = !DILocation(line: 4, column: 3, scope: !4)
!13 = !DILocation(line: 5, column: 1, scope: !4)

View File

@@ -1,70 +0,0 @@
; A by-value struct is a register-indirect value (breg).
; RUN: llc %s -filetype=asm -o - | FileCheck %s
; CHECK: Lsection_info:
; CHECK: DW_AT_location
; CHECK-NEXT: .byte 112
; 112 = 0x70 = DW_OP_breg0
; rdar://problem/13658587
;
; Generated from
;
; struct five
; {
; int a;
; int b;
; int c;
; int d;
; int e;
; };
;
; int
; return_five_int (struct five f)
; {
; return f.a;
; }
target 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-n32:64-S128"
target triple = "arm64-apple-ios3.0.0"
%struct.five = type { i32, i32, i32, i32, i32 }
; Function Attrs: nounwind ssp
define i32 @return_five_int(%struct.five* %f) #0 !dbg !4 {
entry:
call void @llvm.dbg.declare(metadata %struct.five* %f, metadata !17, metadata !DIExpression(DW_OP_deref)), !dbg !18
%a = getelementptr inbounds %struct.five, %struct.five* %f, i32 0, i32 0, !dbg !19
%0 = load i32, i32* %a, align 4, !dbg !19
ret i32 %0, !dbg !19
}
; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
attributes #0 = { nounwind ssp }
attributes #1 = { nounwind readnone }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!16, !20}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, producer: "LLVM version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)
!1 = !DIFile(filename: "struct_by_value.c", directory: "")
!2 = !{}
!4 = distinct !DISubprogram(name: "return_five_int", line: 13, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 14, file: !1, scope: !5, type: !6, variables: !2)
!5 = !DIFile(filename: "struct_by_value.c", directory: "")
!6 = !DISubroutineType(types: !7)
!7 = !{!8, !9}
!8 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!9 = !DICompositeType(tag: DW_TAG_structure_type, name: "five", line: 1, size: 160, align: 32, file: !1, elements: !10)
!10 = !{!11, !12, !13, !14, !15}
!11 = !DIDerivedType(tag: DW_TAG_member, name: "a", line: 3, size: 32, align: 32, file: !1, scope: !9, baseType: !8)
!12 = !DIDerivedType(tag: DW_TAG_member, name: "b", line: 4, size: 32, align: 32, offset: 32, file: !1, scope: !9, baseType: !8)
!13 = !DIDerivedType(tag: DW_TAG_member, name: "c", line: 5, size: 32, align: 32, offset: 64, file: !1, scope: !9, baseType: !8)
!14 = !DIDerivedType(tag: DW_TAG_member, name: "d", line: 6, size: 32, align: 32, offset: 96, file: !1, scope: !9, baseType: !8)
!15 = !DIDerivedType(tag: DW_TAG_member, name: "e", line: 7, size: 32, align: 32, offset: 128, file: !1, scope: !9, baseType: !8)
!16 = !{i32 2, !"Dwarf Version", i32 2}
!17 = !DILocalVariable(name: "f", line: 13, arg: 1, scope: !4, file: !5, type: !9)
!18 = !DILocation(line: 13, scope: !4)
!19 = !DILocation(line: 16, scope: !4)
!20 = !{i32 1, !"Debug Info Version", i32 3}

View File

@@ -1,73 +0,0 @@
; RUN: llc -O0 -mtriple=amdgcn--amdhsa -mcpu=fiji -filetype=obj < %s | llvm-dwarfdump -debug-info - | FileCheck %s
; LLVM IR generated with the following command and OpenCL source:
;
; $clang -cl-std=CL2.0 -g -O0 -target amdgcn-amd-amdhsa -S -emit-llvm <path-to-file>
;
; kernel void kernel1(global int *A) {
; *A = 11;
; }
;
; kernel void kernel2(global int *B) {
; *B = 12;
; }
; Make sure that code pointer size is 8 bytes:
; CHECK: .debug_info contents:
; CHECK: addr_size = 0x08
declare void @llvm.dbg.declare(metadata, metadata, metadata)
define amdgpu_kernel void @kernel1(i32 addrspace(1)* %A) !dbg !7 {
entry:
%A.addr = alloca i32 addrspace(1)*, align 4
store i32 addrspace(1)* %A, i32 addrspace(1)** %A.addr, align 4
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %A.addr, metadata !16, metadata !17), !dbg !18
%0 = load i32 addrspace(1)*, i32 addrspace(1)** %A.addr, align 4, !dbg !19
store i32 11, i32 addrspace(1)* %0, align 4, !dbg !20
ret void, !dbg !21
}
define amdgpu_kernel void @kernel2(i32 addrspace(1)* %B) !dbg !22 {
entry:
%B.addr = alloca i32 addrspace(1)*, align 4
store i32 addrspace(1)* %B, i32 addrspace(1)** %B.addr, align 4
call void @llvm.dbg.declare(metadata i32 addrspace(1)** %B.addr, metadata !23, metadata !17), !dbg !24
%0 = load i32 addrspace(1)*, i32 addrspace(1)** %B.addr, align 4, !dbg !25
store i32 12, i32 addrspace(1)* %0, align 4, !dbg !26
ret void, !dbg !27
}
!llvm.dbg.cu = !{!0}
!opencl.ocl.version = !{!3, !3}
!llvm.module.flags = !{!4, !5}
!llvm.ident = !{!6}
!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
!1 = !DIFile(filename: "dwarfdump-relocs.cl", directory: "/some/random/directory")
!2 = !{}
!3 = !{i32 2, i32 0}
!4 = !{i32 2, !"Dwarf Version", i32 2}
!5 = !{i32 2, !"Debug Info Version", i32 3}
!6 = !{!""}
!7 = distinct !DISubprogram(name: "kernel1", scope: !1, file: !1, line: 1, type: !8, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!8 = !DISubroutineType(types: !9)
!9 = !{null, !10}
!10 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !11, size: 64)
!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
!12 = !{i32 1}
!13 = !{!"none"}
!14 = !{!"int*"}
!15 = !{!""}
!16 = !DILocalVariable(name: "A", arg: 1, scope: !7, file: !1, line: 1, type: !10)
!17 = !DIExpression(DW_OP_constu, 1, DW_OP_swap, DW_OP_xderef)
!18 = !DILocation(line: 1, column: 33, scope: !7)
!19 = !DILocation(line: 2, column: 4, scope: !7)
!20 = !DILocation(line: 2, column: 6, scope: !7)
!21 = !DILocation(line: 3, column: 1, scope: !7)
!22 = distinct !DISubprogram(name: "kernel2", scope: !1, file: !1, line: 5, type: !8, isLocal: false, isDefinition: true, scopeLine: 5, flags: DIFlagPrototyped, isOptimized: false, unit: !0, variables: !2)
!23 = !DILocalVariable(name: "B", arg: 1, scope: !22, file: !1, line: 5, type: !10)
!24 = !DILocation(line: 5, column: 33, scope: !22)
!25 = !DILocation(line: 6, column: 4, scope: !22)
!26 = !DILocation(line: 6, column: 6, scope: !22)
!27 = !DILocation(line: 7, column: 1, scope: !22)

Some files were not shown because too many files have changed in this diff Show More