1; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu -mcpu=corei7 -mattr=+sse2 -asm-instrumentation=address -asan-instrument-assembly | FileCheck %s 2 3target 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" 4target triple = "x86_64-unknown-linux-gnu" 5 6; CHECK-LABEL: mov1b 7; CHECK: leaq -128(%rsp), %rsp 8; CHECK-NEXT: pushq %rax 9; CHECK-NEXT: pushq %rcx 10; CHECK-NEXT: pushq %rdi 11; CHECK-NEXT: pushfq 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 {{.*}} 23; CHECK-NEXT: cld 24; CHECK-NEXT: emms 25; CHECK-NEXT: andq $-16, %rsp 26; CHECK-NEXT: callq __asan_report_load1@PLT 27; CHECK-NEXT: [[A]]: 28; CHECK-NEXT: popfq 29; CHECK-NEXT: popq %rdi 30; CHECK-NEXT: popq %rcx 31; CHECK-NEXT: popq %rax 32; CHECK-NEXT: leaq 128(%rsp), %rsp 33 34; CHECK: leaq -128(%rsp), %rsp 35; CHECK: callq __asan_report_store1@PLT 36; CHECK: leaq 128(%rsp), %rsp 37 38; CHECK: movb {{.*}}, {{.*}} 39define void @mov1b(i8* %dst, i8* %src) #0 { 40entry: 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 42 ret void 43} 44 45; CHECK-LABEL: mov2b 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 50 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 55 56; CHECK: movw {{.*}}, {{.*}} 57define void @mov2b(i16* %dst, i16* %src) #0 { 58entry: 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 60 ret void 61} 62 63; CHECK-LABEL: mov4b 64; CHECK: leaq -128(%rsp), %rsp 65; CHECK: addl $3, %ecx 66; CHECK: callq __asan_report_load4@PLT 67; CHECK: leaq 128(%rsp), %rsp 68 69; CHECK: leaq -128(%rsp), %rsp 70; CHECK: addl $3, %ecx 71; CHECK: callq __asan_report_store4@PLT 72; CHECK: leaq 128(%rsp), %rsp 73 74; CHECK: movl {{.*}}, {{.*}} 75define void @mov4b(i32* %dst, i32* %src) #0 { 76entry: 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 78 ret void 79} 80 81; CHECK-LABEL: mov8b 82; CHECK: leaq -128(%rsp), %rsp 83; CHECK-NEXT: pushq %rax 84; CHECK-NEXT: pushfq 85; CHECK-NEXT: leaq {{.*}}, %rax 86; CHECK-NEXT: shrq $3, %rax 87; CHECK-NEXT: cmpb $0, 2147450880(%rax) 88; CHECK-NEXT: je [[A:.*]] 89; CHECK-NEXT: cld 90; CHECK-NEXT: emms 91; CHECK-NEXT: andq $-16, %rsp 92; CHECK-NEXT: callq __asan_report_load8@PLT 93; CHECK-NEXT: [[A]]: 94; CHECK-NEXT: popfq 95; CHECK-NEXT: popq %rax 96; CHECK-NEXT: leaq 128(%rsp), %rsp 97 98; CHECK: leaq -128(%rsp), %rsp 99; CHECK-NEXT: pushq %rax 100; CHECK-NEXT: pushfq 101; CHECK-NEXT: leaq {{.*}}, %rax 102; CHECK-NEXT: shrq $3, %rax 103; CHECK-NEXT: cmpb $0, 2147450880(%rax) 104; CHECK-NEXT: je [[A:.*]] 105; CHECK-NEXT: cld 106; CHECK-NEXT: emms 107; CHECK-NEXT: andq $-16, %rsp 108; CHECK-NEXT: callq __asan_report_store8@PLT 109; CHECK-NEXT: [[A]]: 110; CHECK-NEXT: popfq 111; CHECK-NEXT: popq %rax 112; CHECK-NEXT: leaq 128(%rsp), %rsp 113 114; CHECK: movq {{.*}}, {{.*}} 115define void @mov8b(i64* %dst, i64* %src) #0 { 116entry: 117 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 118 ret void 119} 120 121; CHECK-LABEL: mov16b 122; CHECK: leaq -128(%rsp), %rsp 123; CHECK: cmpw $0, 2147450880(%rax) 124; CHECK: callq __asan_report_load16@PLT 125; CHECK: leaq 128(%rsp), %rsp 126 127; CHECK: leaq -128(%rsp), %rsp 128; CHECK: cmpw $0, 2147450880(%rax) 129; CHECK: callq __asan_report_store16@PLT 130; CHECK: leaq 128(%rsp), %rsp 131 132; CHECK: movaps {{.*}}, {{.*}} 133define void @mov16b(<2 x i64>* %dst, <2 x i64>* %src) #0 { 134entry: 135 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 136 ret void 137} 138 139attributes #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" } 140attributes #1 = { nounwind } 141 142!0 = metadata !{i32 98, i32 122, i32 160} 143!1 = metadata !{i32 305, i32 329, i32 367} 144!2 = metadata !{i32 512, i32 537, i32 576} 145!3 = metadata !{i32 721, i32 746, i32 785} 146!4 = metadata !{i32 929, i32 957, i32 999} 147