brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.6 KiB · 8b0940d Raw
58 lines · plain
1; RUN: opt -S -passes=asan -asan-use-stack-safety=0 -asan-skip-promotable-allocas=0 %s -o - | FileCheck %s2; Generated from:3; int bar(int y) {4;   return y + 2;5; }6 7source_filename = "/tmp/t.c"8target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"9target triple = "x86_64-apple-macosx10.13.0"10 11; Function Attrs: noinline nounwind optnone sanitize_address ssp uwtable12define i32 @foo(i32 %i) #0 !dbg !8 {13entry:14  %i.addr = alloca i32, align 415  store i32 %i, ptr %i.addr, align 416  call void @llvm.dbg.declare(metadata ptr %i.addr, metadata !12, metadata !DIExpression()), !dbg !1317 18  ; CHECK: %asan_local_stack_base = alloca i6419  ; CHECK: %[[PHI:.*]] = phi ptr {{.*}} %MyAlloca20  ; CHECK: store ptr %[[PHI]], ptr %asan_local_stack_base21; CHECK: #dbg_declare(ptr %asan_local_stack_base, [[VAR_I:![0-9]+]], !DIExpression(DW_OP_deref, DW_OP_plus_uconst, 32), [[LOC_I:![0-9]+]]22  %0 = load i32, ptr %i.addr, align 4, !dbg !1423  %add = add nsw i32 %0, 2, !dbg !1524  ret i32 %add, !dbg !1625}26 27; CHECK: [[SCOPE:![0-9]+]] = distinct !DISubprogram(name: "foo"28; CHECK: [[VAR_I]] = !DILocalVariable(name: "i", arg: 1, scope: [[SCOPE]]29; CHECK: [[LOC_I]] = !DILocation(line: 1, column: 13, scope: [[SCOPE]]30 31; Function Attrs: nounwind readnone speculatable32declare void @llvm.dbg.declare(metadata, metadata, metadata) #133 34attributes #0 = { noinline nounwind optnone sanitize_address ssp uwtable }35attributes #1 = { nounwind readnone speculatable }36 37!llvm.dbg.cu = !{!0}38!llvm.module.flags = !{!3, !4, !5, !6}39!llvm.ident = !{!7}40 41!0 = distinct !DICompileUnit(language: DW_LANG_C99, file: !1, producer: "clang version 6.0.0 (trunk 320115) (llvm/trunk 320116)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)42!1 = !DIFile(filename: "/tmp/t.c", directory: "/Data/llvm")43!2 = !{}44!3 = !{i32 2, !"Dwarf Version", i32 4}45!4 = !{i32 2, !"Debug Info Version", i32 3}46!5 = !{i32 1, !"wchar_size", i32 4}47!6 = !{i32 7, !"PIC Level", i32 2}48!7 = !{!"clang version 6.0.0 (trunk 320115) (llvm/trunk 320116)"}49!8 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 1, type: !9, isLocal: false, isDefinition: true, scopeLine: 1, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)50!9 = !DISubroutineType(types: !10)51!10 = !{!11, !11}52!11 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)53!12 = !DILocalVariable(name: "i", arg: 1, scope: !8, file: !1, line: 1, type: !11)54!13 = !DILocation(line: 1, column: 13, scope: !8)55!14 = !DILocation(line: 2, column: 10, scope: !8)56!15 = !DILocation(line: 2, column: 12, scope: !8)57!16 = !DILocation(line: 2, column: 3, scope: !8)58