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 them
5 ; RUN: opt < %s -passes=asan -S | FileCheck %s
6 ; RUN: opt < %s -passes=asan -asan-instrument-dynamic-allocas -S | FileCheck %s
8 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
9 target triple = "x86_64-apple-macosx10.10.0"
11 define i32 @foo() sanitize_address {
13 ; Won't be instrumented because of asan-skip-promotable-allocas.
14 %non_instrumented1 = alloca i32, align 4
16 ; Regular alloca, will get instrumented (forced by the ptrtoint below).
17 %instrumented = alloca i32, align 4
19 ; Won't be instrumented because of asan-skip-promotable-allocas.
20 %non_instrumented2 = alloca i32, align 4
25 ; Won't be instrumented because of asan-skip-promotable-allocas.
26 %non_instrumented3 = alloca i32, align 4
28 %ptr = ptrtoint ptr %instrumented to i32
36 ; CHECK: %non_instrumented1 = alloca i32, align 4
37 ; CHECK: %non_instrumented2 = alloca i32, align 4
38 ; CHECK: load i32, ptr @__asan_option_detect_stack_use_after_return
40 ; CHECK: %non_instrumented3 = alloca i32, align 4