1 ; RUN: opt < %s -asan -S -o %t.ll
2 ; RUN: FileCheck %s < %t.ll
4 ; Don't do stack malloc on functions containing inline assembly on 64-bit
5 ; platforms. It makes LLVM run out of registers.
7 ; CHECK-LABEL: define void @TestAbsenceOfStackMalloc(i8* %S, i32 %pS, i8* %D, i32 %pD, i32 %h)
9 ; CHECK-NOT: call {{.*}} @__asan_stack_malloc
11 target datalayout = "e-m:o-i64:64-f80:128-n8:16:32:64-S128"
12 target triple = "x86_64-apple-macosx10.10.0"
14 define void @TestAbsenceOfStackMalloc(i8* %S, i32 %pS, i8* %D, i32 %pD, i32 %h) #0 {
16 %S.addr = alloca i8*, align 8
17 %pS.addr = alloca i32, align 4
18 %D.addr = alloca i8*, align 8
19 %pD.addr = alloca i32, align 4
20 %h.addr = alloca i32, align 4
21 %sr = alloca i32, align 4
22 %pDiffD = alloca i32, align 4
23 %pDiffS = alloca i32, align 4
24 %flagSA = alloca i8, align 1
25 %flagDA = alloca i8, align 1
26 store i8* %S, i8** %S.addr, align 8
27 store i32 %pS, i32* %pS.addr, align 4
28 store i8* %D, i8** %D.addr, align 8
29 store i32 %pD, i32* %pD.addr, align 4
30 store i32 %h, i32* %h.addr, align 4
31 store i32 4, i32* %sr, align 4
32 %0 = load i32, i32* %pD.addr, align 4
34 store i32 %sub, i32* %pDiffD, align 4
35 %1 = load i32, i32* %pS.addr, align 4
37 %sub1 = sub i32 %shl, 5
38 store i32 %sub1, i32* %pDiffS, align 4
39 %2 = load i32, i32* %pS.addr, align 4
41 %cmp = icmp eq i32 %and, 0
42 %conv = zext i1 %cmp to i32
43 %conv2 = trunc i32 %conv to i8
44 store i8 %conv2, i8* %flagSA, align 1
45 %3 = load i32, i32* %pD.addr, align 4
46 %and3 = and i32 %3, 15
47 %cmp4 = icmp eq i32 %and3, 0
48 %conv5 = zext i1 %cmp4 to i32
49 %conv6 = trunc i32 %conv5 to i8
50 store i8 %conv6, i8* %flagDA, align 1
51 call void asm sideeffect "mov\09\09\09$0,\09\09\09\09\09\09\09\09\09\09%rsi\0Amov\09\09\09$2,\09\09\09\09\09\09\09\09\09\09%rcx\0Amov\09\09\09$1,\09\09\09\09\09\09\09\09\09\09%rdi\0Amov\09\09\09$8,\09\09\09\09\09\09\09\09\09\09%rax\0A", "*m,*m,*m,*m,*m,*m,*m,*m,*m,~{rsi},~{rdi},~{rax},~{rcx},~{rdx},~{memory},~{dirflag},~{fpsr},~{flags}"(i8** %S.addr, i8** %D.addr, i32* %pS.addr, i32* %pDiffS, i32* %pDiffD, i32* %sr, i8* %flagSA, i8* %flagDA, i32* %h.addr) #1
55 attributes #0 = { nounwind sanitize_address }
56 attributes #1 = { nounwind }