brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 6237673 Raw
41 lines · plain
1; This test checks that non-instrumented allocas stay in the first basic block.2; Only first-basic-block allocas are considered stack slots, and moving them3; breaks debug info.4 5; RUN: opt < %s -passes=asan -S | FileCheck %s6; RUN: opt < %s -passes=asan -asan-instrument-dynamic-allocas -S | FileCheck %s7 8target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"9target triple = "x86_64-apple-macosx10.10.0"10 11define i32 @foo() sanitize_address {12entry:13  ; Won't be instrumented because of asan-skip-promotable-allocas.14  %non_instrumented1 = alloca i32, align 415 16  ; Regular alloca, will get instrumented (forced by the ptrtoint below).17  %instrumented = alloca i32, align 418 19  ; Won't be instrumented because of asan-skip-promotable-allocas.20  %non_instrumented2 = alloca i32, align 421 22  br label %bb023 24bb0:25  ; Won't be instrumented because of asan-skip-promotable-allocas.26  %non_instrumented3 = alloca i32, align 427 28  %ptr = ptrtoint ptr %instrumented to i3229  br label %bb130 31bb1:32  ret i32 %ptr33}34 35; CHECK: entry:36; CHECK: %non_instrumented1 = alloca i32, align 437; CHECK: %non_instrumented2 = alloca i32, align 438; CHECK: load i32, ptr @__asan_option_detect_stack_use_after_return39; CHECK: bb0:40; CHECK: %non_instrumented3 = alloca i32, align 441