1*9880d681SAndroid Build Coastguard Worker; RUN: opt < %s -asan -asan-module -asan-instrument-allocas=1 -S | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Workertarget datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
4*9880d681SAndroid Build Coastguard Workertarget triple = "x86_64-apple-macosx10.10.0"
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Workerdefine i32 @test_promotable_allocas() sanitize_address {
7*9880d681SAndroid Build Coastguard Workerentry:
8*9880d681SAndroid Build Coastguard Worker; CHECK: %0 = alloca i32, align 4
9*9880d681SAndroid Build Coastguard Worker; CHECK: store i32 0, i32* %0, align 4
10*9880d681SAndroid Build Coastguard Worker; CHECK: %1 = load i32, i32* %0, align 4
11*9880d681SAndroid Build Coastguard Worker; CHECK: ret i32 %1
12*9880d681SAndroid Build Coastguard Worker
13*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: __asan_stack_malloc_0
14*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: icmp
15*9880d681SAndroid Build Coastguard Worker; CHECK-NOT: call void @__asan_report_store4
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Worker  %0 = alloca i32, align 4
18*9880d681SAndroid Build Coastguard Worker  store i32 0, i32* %0, align 4
19*9880d681SAndroid Build Coastguard Worker  %1 = load i32, i32* %0, align 4
20*9880d681SAndroid Build Coastguard Worker  ret i32 %1
21*9880d681SAndroid Build Coastguard Worker}
22