1 ; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2 -asm-instrumentation=address -asan-instrument-assembly | FileCheck %s
3 target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
4 target triple = "x86_64-unknown-linux-gnu"
7 ; CHECK: leaq -128(%rsp), %rsp
8 ; CHECK-NEXT: pushq %rax
9 ; CHECK-NEXT: pushq %rdi
10 ; CHECK-NEXT: pushq %rcx
12 ; CHECK-NEXT: leaq {{.*}}, %rdi
13 ; CHECK-NEXT: movq %rdi, %rax
14 ; CHECK-NEXT: shrq $3, %rax
15 ; CHECK-NEXT: movb 2147450880(%rax), %al
16 ; CHECK-NEXT: testb %al, %al
17 ; CHECK-NEXT: je [[A:.*]]
18 ; CHECK-NEXT: movl %edi, %ecx
19 ; CHECK-NEXT: andl $7, %ecx
20 ; CHECK-NEXT: movsbl %al, %eax
21 ; CHECK-NEXT: cmpl %eax, %ecx
22 ; CHECK-NEXT: jl {{.*}}
25 ; CHECK-NEXT: andq $-16, %rsp
26 ; CHECK-NEXT: callq __asan_report_load1@PLT
29 ; CHECK-NEXT: popq %rcx
30 ; CHECK-NEXT: popq %rdi
31 ; CHECK-NEXT: popq %rax
32 ; CHECK-NEXT: leaq 128(%rsp), %rsp
34 ; CHECK: leaq -128(%rsp), %rsp
35 ; CHECK: callq __asan_report_store1@PLT
36 ; CHECK: leaq 128(%rsp), %rsp
38 ; CHECK: movb {{.*}}, {{.*}}
39 define void @mov1b(i8* %dst, i8* %src) #0 {
41 tail call void asm sideeffect "movb ($1), %al \0A\09movb %al, ($0) \0A\09", "r,r,~{memory},~{rax},~{dirflag},~{fpsr},~{flags}"(i8* %dst, i8* %src) #1, !srcloc !0
46 ; CHECK: leaq -128(%rsp), %rsp
47 ; CHECK: leal 1(%ecx), %ecx
48 ; CHECK: callq __asan_report_load2@PLT
49 ; CHECK: leaq 128(%rsp), %rsp
51 ; CHECK: leaq -128(%rsp), %rsp
52 ; CHECK: leal 1(%ecx), %ecx
53 ; CHECK: callq __asan_report_store2@PLT
54 ; CHECK: leaq 128(%rsp), %rsp
56 ; CHECK: movw {{.*}}, {{.*}}
57 define void @mov2b(i16* %dst, i16* %src) #0 {
59 tail call void asm sideeffect "movw ($1), %ax \0A\09movw %ax, ($0) \0A\09", "r,r,~{memory},~{rax},~{dirflag},~{fpsr},~{flags}"(i16* %dst, i16* %src) #1, !srcloc !1
64 ; CHECK: leaq -128(%rsp), %rsp
65 ; CHECK: addl $3, %ecx
66 ; CHECK: callq __asan_report_load4@PLT
67 ; CHECK: leaq 128(%rsp), %rsp
69 ; CHECK: leaq -128(%rsp), %rsp
70 ; CHECK: addl $3, %ecx
71 ; CHECK: callq __asan_report_store4@PLT
72 ; CHECK: leaq 128(%rsp), %rsp
74 ; CHECK: movl {{.*}}, {{.*}}
75 define void @mov4b(i32* %dst, i32* %src) #0 {
77 tail call void asm sideeffect "movl ($1), %eax \0A\09movl %eax, ($0) \0A\09", "r,r,~{memory},~{rax},~{dirflag},~{fpsr},~{flags}"(i32* %dst, i32* %src) #1, !srcloc !2
82 ; CHECK: leaq -128(%rsp), %rsp
83 ; CHECK-NEXT: pushq %rax
84 ; CHECK-NEXT: pushq %rdi
86 ; CHECK-NEXT: leaq {{.*}}, %rdi
87 ; CHECK-NEXT: movq %rdi, %rax
88 ; CHECK-NEXT: shrq $3, %rax
89 ; CHECK-NEXT: cmpb $0, 2147450880(%rax)
90 ; CHECK-NEXT: je [[A:.*]]
93 ; CHECK-NEXT: andq $-16, %rsp
94 ; CHECK-NEXT: callq __asan_report_load8@PLT
97 ; CHECK-NEXT: popq %rdi
98 ; CHECK-NEXT: popq %rax
99 ; CHECK-NEXT: leaq 128(%rsp), %rsp
101 ; CHECK: leaq -128(%rsp), %rsp
102 ; CHECK-NEXT: pushq %rax
103 ; CHECK-NEXT: pushq %rdi
105 ; CHECK-NEXT: leaq {{.*}}, %rdi
106 ; CHECK-NEXT: movq %rdi, %rax
107 ; CHECK-NEXT: shrq $3, %rax
108 ; CHECK-NEXT: cmpb $0, 2147450880(%rax)
109 ; CHECK-NEXT: je [[A:.*]]
112 ; CHECK-NEXT: andq $-16, %rsp
113 ; CHECK-NEXT: callq __asan_report_store8@PLT
116 ; CHECK-NEXT: popq %rdi
117 ; CHECK-NEXT: popq %rax
118 ; CHECK-NEXT: leaq 128(%rsp), %rsp
120 ; CHECK: movq {{.*}}, {{.*}}
121 define void @mov8b(i64* %dst, i64* %src) #0 {
123 tail call void asm sideeffect "movq ($1), %rax \0A\09movq %rax, ($0) \0A\09", "r,r,~{memory},~{rax},~{dirflag},~{fpsr},~{flags}"(i64* %dst, i64* %src) #1, !srcloc !3
127 ; CHECK-LABEL: mov16b
128 ; CHECK: leaq -128(%rsp), %rsp
129 ; CHECK: cmpw $0, 2147450880(%rax)
130 ; CHECK: callq __asan_report_load16@PLT
131 ; CHECK: leaq 128(%rsp), %rsp
133 ; CHECK: leaq -128(%rsp), %rsp
134 ; CHECK: cmpw $0, 2147450880(%rax)
135 ; CHECK: callq __asan_report_store16@PLT
136 ; CHECK: leaq 128(%rsp), %rsp
138 ; CHECK: movaps {{.*}}, {{.*}}
139 define void @mov16b(<2 x i64>* %dst, <2 x i64>* %src) #0 {
141 tail call void asm sideeffect "movaps ($1), %xmm0 \0A\09movaps %xmm0, ($0) \0A\09", "r,r,~{memory},~{xmm0},~{dirflag},~{fpsr},~{flags}"(<2 x i64>* %dst, <2 x i64>* %src) #1, !srcloc !4
145 attributes #0 = { nounwind uwtable sanitize_address "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-frame-pointer-elim-non-leaf"="false" "no-infs-fp-math"="false" "no-nans-fp-math"="false" "unsafe-fp-math"="false" "use-soft-float"="false" }
146 attributes #1 = { nounwind }
148 !0 = metadata !{i32 98, i32 122, i32 160}
149 !1 = metadata !{i32 305, i32 329, i32 367}
150 !2 = metadata !{i32 512, i32 537, i32 576}
151 !3 = metadata !{i32 721, i32 746, i32 785}
152 !4 = metadata !{i32 929, i32 957, i32 999}