brintos

brintos / llvm-project-archived public Read only

0
0
Text · 6.5 KiB · afd60e2 Raw
176 lines · plain
1; RUN: llc -filetype=obj -O0 < %s2; Test that we handle DBG_VALUEs in a register without crashing.3;4; Generated from clang with -fsanitize=address:5; struct A {6;   A();7;   A(const A&);8; };9;10; A func(int) {11;   A a;12;   return a;13; }14 15target 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"16target triple = "x86_64-unknown-linux-gnu"17 18%struct.A = type { i8 }19 20@__asan_mapping_offset = linkonce_odr constant i64 214745088021@__asan_mapping_scale = linkonce_odr constant i64 322@llvm.global_ctors = appending global [1 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 1, ptr @asan.module_ctor, ptr null }]23@___asan_gen_ = private unnamed_addr constant [16 x i8] c"1 32 4 5 .addr \00", align 124 25; Function Attrs: sanitize_address uwtable26define void @_Z4funci(ptr noalias sret(%struct.A) %agg.result, i32) #0 "stack-protector-buffer-size"="1" !dbg !4 {27entry:28  %MyAlloca = alloca [96 x i8], align 3229  %1 = ptrtoint ptr %MyAlloca to i6430  %2 = add i64 %1, 3231  %3 = inttoptr i64 %2 to ptr32  %4 = inttoptr i64 %1 to ptr33  store i64 1102416563, ptr %434  %5 = add i64 %1, 835  %6 = inttoptr i64 %5 to ptr36  store i64 ptrtoint (ptr @___asan_gen_ to i64), ptr %637  %7 = add i64 %1, 1638  %8 = inttoptr i64 %7 to ptr39  store i64 ptrtoint (ptr @_Z4funci to i64), ptr %840  %9 = lshr i64 %1, 341  %10 = add i64 %9, 214745088042  %11 = inttoptr i64 %10 to ptr43  store i32 -235802127, ptr %1144  %12 = add i64 %10, 445  %13 = inttoptr i64 %12 to ptr46  store i32 -185273340, ptr %1347  %14 = add i64 %10, 848  %15 = inttoptr i64 %14 to ptr49  store i32 -202116109, ptr %1550  %16 = ptrtoint ptr %3 to i6451  %17 = lshr i64 %16, 352  %18 = add i64 %17, 214745088053  %19 = inttoptr i64 %18 to ptr54  %20 = load i8, ptr %1955  %21 = icmp ne i8 %20, 056  call void @llvm.dbg.declare(metadata ptr %3, metadata !23, metadata !28), !dbg !DILocation(scope: !4)57  br i1 %21, label %22, label %2858 59; <label>:22                                      ; preds = %entry60  %23 = and i64 %16, 761  %24 = add i64 %23, 362  %25 = trunc i64 %24 to i863  %26 = icmp sge i8 %25, %2064  br i1 %26, label %27, label %2865 66; <label>:27                                      ; preds = %2267  call void @__asan_report_store4(i64 %16)68  call void asm sideeffect "", ""()69  unreachable70 71; <label>:28                                      ; preds = %22, %entry72  store i32 %0, ptr %3, align 473  call void @llvm.dbg.declare(metadata ptr %agg.result, metadata !24, metadata !DIExpression()), !dbg !2574  call void @_ZN1AC1Ev(ptr %agg.result), !dbg !2575  store i64 1172321806, ptr %4, !dbg !2676  %29 = inttoptr i64 %10 to ptr, !dbg !2677  store i32 0, ptr %29, !dbg !2678  %30 = add i64 %10, 4, !dbg !2679  %31 = inttoptr i64 %30 to ptr, !dbg !2680  store i32 0, ptr %31, !dbg !2681  %32 = add i64 %10, 8, !dbg !2682  %33 = inttoptr i64 %32 to ptr, !dbg !2683  store i32 0, ptr %33, !dbg !2684  ret void, !dbg !2685}86 87; Function Attrs: nounwind readnone88declare void @llvm.dbg.declare(metadata, metadata, metadata) #189 90declare void @_ZN1AC1Ev(ptr) #291 92define internal void @asan.module_ctor()  "stack-protector-buffer-size"="1" {93  call void @__asan_init_v3()94  %1 = load volatile i64, ptr @__asan_mapping_offset95  %2 = load volatile i64, ptr @__asan_mapping_scale96  ret void97}98 99declare void @__asan_init_v3()100 101declare void @__asan_report_load1(i64)102 103declare void @__asan_report_load2(i64)104 105declare void @__asan_report_load4(i64)106 107declare void @__asan_report_load8(i64)108 109declare void @__asan_report_load16(i64)110 111declare void @__asan_report_store1(i64)112 113declare void @__asan_report_store2(i64)114 115declare void @__asan_report_store4(i64)116 117declare void @__asan_report_store8(i64)118 119declare void @__asan_report_store16(i64)120 121declare void @__asan_report_load_n(i64, i64)122 123declare void @__asan_report_store_n(i64, i64)124 125declare void @__asan_handle_no_return()126 127declare i64 @__asan_stack_malloc(i64, i64)128 129declare void @__asan_stack_free(i64, i64, i64)130 131declare void @__asan_poison_stack_memory(i64, i64)132 133declare void @__asan_unpoison_stack_memory(i64, i64)134 135declare void @__asan_before_dynamic_init(i64)136 137declare void @__asan_after_dynamic_init()138 139declare void @__asan_register_globals(i64, i64)140 141declare void @__asan_unregister_globals(i64, i64)142 143attributes #0 = { sanitize_address uwtable "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "ssp-buffer-size"="8" "use-soft-float"="false" }144attributes #1 = { nounwind readnone }145attributes #2 = { "less-precise-fpmad"="false" "frame-pointer"="all" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "ssp-buffer-size"="8" "use-soft-float"="false" }146 147!llvm.dbg.cu = !{!0}148!llvm.module.flags = !{!22, !27}149 150!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.4 ", isOptimized: false, emissionKind: FullDebug, file: !1, enums: !2, retainedTypes: !2, globals: !2, imports: !2)151!1 = !DIFile(filename: "crash.cpp", directory: "/tmp")152!2 = !{}153!4 = distinct !DISubprogram(name: "func", linkageName: "_Z4funci", line: 6, isLocal: false, isDefinition: true, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, scopeLine: 6, file: !1, scope: !5, type: !6, retainedNodes: !2)154!5 = !DIFile(filename: "crash.cpp", directory: "/tmp")155!6 = !DISubroutineType(types: !7)156!7 = !{!8, !21}157!8 = !DICompositeType(tag: DW_TAG_structure_type, name: "A", line: 1, size: 8, align: 8, file: !1, elements: !9)158!9 = !{!10, !15}159!10 = !DISubprogram(name: "A", line: 2, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 2, file: !1, scope: !8, type: !11)160!11 = !DISubroutineType(types: !12)161!12 = !{null, !13}162!13 = !DIDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !8)163!15 = !DISubprogram(name: "A", line: 3, isLocal: false, isDefinition: false, virtualIndex: 6, flags: DIFlagPrototyped, isOptimized: false, scopeLine: 3, file: !1, scope: !8, type: !16)164!16 = !DISubroutineType(types: !17)165!17 = !{null, !13, !18}166!18 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !19)167!19 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8)168!21 = !DIBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)169!22 = !{i32 2, !"Dwarf Version", i32 3}170!23 = !DILocalVariable(name: "", line: 6, arg: 1, scope: !4, file: !5, type: !21)171!24 = !DILocalVariable(name: "a", line: 7, scope: !4, file: !5, type: !8)172!25 = !DILocation(line: 7, scope: !4)173!26 = !DILocation(line: 8, scope: !4)174!27 = !{i32 1, !"Debug Info Version", i32 3}175!28 = !DIExpression(DW_OP_deref)176