diff options
Diffstat (limited to 'test/Instrumentation/AddressSanitizer/X86')
6 files changed, 91 insertions, 93 deletions
diff --git a/test/Instrumentation/AddressSanitizer/X86/asm_attr.ll b/test/Instrumentation/AddressSanitizer/X86/asm_attr.ll index b83a7e9..0667a14 100644 --- a/test/Instrumentation/AddressSanitizer/X86/asm_attr.ll +++ b/test/Instrumentation/AddressSanitizer/X86/asm_attr.ll @@ -4,16 +4,16 @@ target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128" target triple = "x86_64-unknown-linux-gnu" ; CHECK-LABEL: mov_no_attr -; CHECK-NOT: callq __sanitizer_sanitize_load8@PLT -; CHECK-NOT: callq __sanitizer_sanitize_store8@PLT +; CHECK-NOT: callq __asan_report_load@PLT +; CHECK-NOT: callq __asan_report_store@PLT define void @mov_no_attr(i64* %dst, i64* %src) { 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) ret void } ; CHECK-LABEL: mov_sanitize -; CHECK: callq __sanitizer_sanitize_load8@PLT -; CHECK: callq __sanitizer_sanitize_store8@PLT +; CHECK: callq __asan_report_load8@PLT +; CHECK: callq __asan_report_store8@PLT define void @mov_sanitize(i64* %dst, i64* %src) sanitize_address { 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) ret void diff --git a/test/Instrumentation/AddressSanitizer/X86/asm_mov.ll b/test/Instrumentation/AddressSanitizer/X86/asm_mov.ll index 030af7e..ad5e02e 100644 --- a/test/Instrumentation/AddressSanitizer/X86/asm_mov.ll +++ b/test/Instrumentation/AddressSanitizer/X86/asm_mov.ll @@ -5,18 +5,35 @@ target triple = "x86_64-unknown-linux-gnu" ; CHECK-LABEL: mov1b ; CHECK: leaq -128(%rsp), %rsp +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: pushq %rcx ; CHECK-NEXT: pushq %rdi +; CHECK-NEXT: pushfq ; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_load1@PLT +; CHECK-NEXT: movq %rdi, %rax +; CHECK-NEXT: shrq $3, %rax +; CHECK-NEXT: movb 2147450880(%rax), %al +; CHECK-NEXT: testb %al, %al +; CHECK-NEXT: je [[A:.*]] +; CHECK-NEXT: movl %edi, %ecx +; CHECK-NEXT: andl $7, %ecx +; CHECK-NEXT: movsbl %al, %eax +; CHECK-NEXT: cmpl %eax, %ecx +; CHECK-NEXT: jl {{.*}} +; CHECK-NEXT: cld +; CHECK-NEXT: emms +; CHECK-NEXT: andq $-16, %rsp +; CHECK-NEXT: callq __asan_report_load1@PLT +; CHECK-NEXT: [[A]]: +; CHECK-NEXT: popfq ; CHECK-NEXT: popq %rdi +; CHECK-NEXT: popq %rcx +; CHECK-NEXT: popq %rax ; CHECK-NEXT: leaq 128(%rsp), %rsp ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_store1@PLT -; CHECK-NEXT: popq %rdi -; CHECK-NEXT: leaq 128(%rsp), %rsp +; CHECK: callq __asan_report_store1@PLT +; CHECK: leaq 128(%rsp), %rsp ; CHECK: movb {{.*}}, {{.*}} define void @mov1b(i8* %dst, i8* %src) #0 { @@ -27,18 +44,14 @@ entry: ; CHECK-LABEL: mov2b ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_load2@PLT -; CHECK-NEXT: popq %rdi -; CHECK-NEXT: leaq 128(%rsp), %rsp +; CHECK: leal 1(%ecx), %ecx +; CHECK: callq __asan_report_load2@PLT +; CHECK: leaq 128(%rsp), %rsp ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_store2@PLT -; CHECK-NEXT: popq %rdi -; CHECK-NEXT: leaq 128(%rsp), %rsp +; CHECK: leal 1(%ecx), %ecx +; CHECK: callq __asan_report_store2@PLT +; CHECK: leaq 128(%rsp), %rsp ; CHECK: movw {{.*}}, {{.*}} define void @mov2b(i16* %dst, i16* %src) #0 { @@ -49,18 +62,14 @@ entry: ; CHECK-LABEL: mov4b ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_load4@PLT -; CHECK-NEXT: popq %rdi -; CHECK-NEXT: leaq 128(%rsp), %rsp +; CHECK: addl $3, %ecx +; CHECK: callq __asan_report_load4@PLT +; CHECK: leaq 128(%rsp), %rsp ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_store4@PLT -; CHECK-NEXT: popq %rdi -; CHECK-NEXT: leaq 128(%rsp), %rsp +; CHECK: addl $3, %ecx +; CHECK: callq __asan_report_store4@PLT +; CHECK: leaq 128(%rsp), %rsp ; CHECK: movl {{.*}}, {{.*}} define void @mov4b(i32* %dst, i32* %src) #0 { @@ -71,17 +80,35 @@ entry: ; CHECK-LABEL: mov8b ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_load8@PLT -; CHECK-NEXT: popq %rdi +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: pushfq +; CHECK-NEXT: leaq {{.*}}, %rax +; CHECK-NEXT: shrq $3, %rax +; CHECK-NEXT: cmpb $0, 2147450880(%rax) +; CHECK-NEXT: je [[A:.*]] +; CHECK-NEXT: cld +; CHECK-NEXT: emms +; CHECK-NEXT: andq $-16, %rsp +; CHECK-NEXT: callq __asan_report_load8@PLT +; CHECK-NEXT: [[A]]: +; CHECK-NEXT: popfq +; CHECK-NEXT: popq %rax ; CHECK-NEXT: leaq 128(%rsp), %rsp ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_store8@PLT -; CHECK-NEXT: popq %rdi +; CHECK-NEXT: pushq %rax +; CHECK-NEXT: pushfq +; CHECK-NEXT: leaq {{.*}}, %rax +; CHECK-NEXT: shrq $3, %rax +; CHECK-NEXT: cmpb $0, 2147450880(%rax) +; CHECK-NEXT: je [[A:.*]] +; CHECK-NEXT: cld +; CHECK-NEXT: emms +; CHECK-NEXT: andq $-16, %rsp +; CHECK-NEXT: callq __asan_report_store8@PLT +; CHECK-NEXT: [[A]]: +; CHECK-NEXT: popfq +; CHECK-NEXT: popq %rax ; CHECK-NEXT: leaq 128(%rsp), %rsp ; CHECK: movq {{.*}}, {{.*}} @@ -93,18 +120,14 @@ entry: ; CHECK-LABEL: mov16b ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_load16@PLT -; CHECK-NEXT: popq %rdi -; CHECK-NEXT: leaq 128(%rsp), %rsp +; CHECK: cmpw $0, 2147450880(%rax) +; CHECK: callq __asan_report_load16@PLT +; CHECK: leaq 128(%rsp), %rsp ; CHECK: leaq -128(%rsp), %rsp -; CHECK-NEXT: pushq %rdi -; CHECK-NEXT: leaq {{.*}}, %rdi -; CHECK-NEXT: callq __sanitizer_sanitize_store16@PLT -; CHECK-NEXT: popq %rdi -; CHECK-NEXT: leaq 128(%rsp), %rsp +; CHECK: cmpw $0, 2147450880(%rax) +; CHECK: callq __asan_report_store16@PLT +; CHECK: leaq 128(%rsp), %rsp ; CHECK: movaps {{.*}}, {{.*}} define void @mov16b(<2 x i64>* %dst, <2 x i64>* %src) #0 { diff --git a/test/Instrumentation/AddressSanitizer/X86/asm_mov.s b/test/Instrumentation/AddressSanitizer/X86/asm_mov.s index df217c0..74a788c 100644 --- a/test/Instrumentation/AddressSanitizer/X86/asm_mov.s +++ b/test/Instrumentation/AddressSanitizer/X86/asm_mov.s @@ -7,20 +7,14 @@ # CHECK-LABEL: mov1b: # # CHECK: leaq -128(%rsp), %rsp -# CHECK-NEXT: pushq %rdi -# CHECK-NEXT: leaq (%rsi), %rdi -# CHECK-NEXT: callq __sanitizer_sanitize_load1@PLT -# CHECK-NEXT: popq %rdi -# CHECK-NEXT: leaq 128(%rsp), %rsp +# CHECK: callq __asan_report_load1@PLT +# CHECK: leaq 128(%rsp), %rsp # # CHECK-NEXT: movb (%rsi), %al # # CHECK-NEXT: leaq -128(%rsp), %rsp -# CHECK-NEXT: pushq %rdi -# CHECK-NEXT: leaq (%rdi), %rdi -# CHECK-NEXT: callq __sanitizer_sanitize_store1@PLT -# CHECK-NEXT: popq %rdi -# CHECK-NEXT: leaq 128(%rsp), %rsp +# CHECK: callq __asan_report_store1@PLT +# CHECK: leaq 128(%rsp), %rsp # # CHECK-NEXT: movb %al, (%rdi) mov1b: # @mov1b @@ -42,20 +36,14 @@ mov1b: # @mov1b # CHECK-LABEL: mov16b: # # CHECK: leaq -128(%rsp), %rsp -# CHECK-NEXT: pushq %rdi -# CHECK-NEXT: leaq (%rsi), %rdi -# CHECK-NEXT: callq __sanitizer_sanitize_load16@PLT -# CHECK-NEXT: popq %rdi -# CHECK-NEXT: leaq 128(%rsp), %rsp +# CHECK: callq __asan_report_load16@PLT +# CHECK: leaq 128(%rsp), %rsp # # CHECK-NEXT: movaps (%rsi), %xmm0 # # CHECK-NEXT: leaq -128(%rsp), %rsp -# CHECK-NEXT: pushq %rdi -# CHECK-NEXT: leaq (%rdi), %rdi -# CHECK-NEXT: callq __sanitizer_sanitize_store16@PLT -# CHECK-NEXT: popq %rdi -# CHECK-NEXT: leaq 128(%rsp), %rsp +# CHECK: callq __asan_report_store16@PLT +# CHECK: leaq 128(%rsp), %rsp # # CHECK-NEXT: movaps %xmm0, (%rdi) mov16b: # @mov16b diff --git a/test/Instrumentation/AddressSanitizer/X86/asm_mov_no_instrumentation.s b/test/Instrumentation/AddressSanitizer/X86/asm_mov_no_instrumentation.s index cc05527..e3a1541 100644 --- a/test/Instrumentation/AddressSanitizer/X86/asm_mov_no_instrumentation.s +++ b/test/Instrumentation/AddressSanitizer/X86/asm_mov_no_instrumentation.s @@ -5,8 +5,8 @@ .align 16, 0x90 .type mov1b,@function # CHECK-LABEL: mov1b -# CHECK-NOT: callq __sanitizer_sanitize_load1@PLT -# CHECK-NOT: callq __sanitizer_sanitize_store1@PLT +# CHECK-NOT: callq __asan_report_load1@PLT +# CHECK-NOT: callq __asan_report_store1@PLT mov1b: # @mov1b .cfi_startproc # BB#0: diff --git a/test/Instrumentation/AddressSanitizer/X86/asm_swap_intel.s b/test/Instrumentation/AddressSanitizer/X86/asm_swap_intel.s index 8a6a8d5..ca3c54c 100644 --- a/test/Instrumentation/AddressSanitizer/X86/asm_swap_intel.s +++ b/test/Instrumentation/AddressSanitizer/X86/asm_swap_intel.s @@ -7,38 +7,26 @@ # CHECK-LABEL: swap: # # CHECK: leaq -128(%rsp), %rsp -# CHECK-NEXT: pushq %rdi -# CHECK-NEXT: leaq (%rcx), %rdi -# CHECK-NEXT: callq __sanitizer_sanitize_load8@PLT -# CHECK-NEXT: popq %rdi -# CHECK-NEXT: leaq 128(%rsp), %rsp +# CHECK: callq __asan_report_load8@PLT +# CHECK: leaq 128(%rsp), %rsp # # CHECK-NEXT: movq (%rcx), %rax # # CHECK-NEXT: leaq -128(%rsp), %rsp -# CHECK-NEXT: pushq %rdi -# CHECK-NEXT: leaq (%rdx), %rdi -# CHECK-NEXT: callq __sanitizer_sanitize_load8@PLT -# CHECK-NEXT: popq %rdi -# CHECK-NEXT: leaq 128(%rsp), %rsp +# CHECK: callq __asan_report_load8@PLT +# CHECK: leaq 128(%rsp), %rsp # # CHECK-NEXT: movq (%rdx), %rbx # -# CHECK: leaq -128(%rsp), %rsp -# CHECK-NEXT: pushq %rdi -# CHECK-NEXT: leaq (%rcx), %rdi -# CHECK-NEXT: callq __sanitizer_sanitize_store8@PLT -# CHECK-NEXT: popq %rdi -# CHECK-NEXT: leaq 128(%rsp), %rsp +# CHECK-NEXT: leaq -128(%rsp), %rsp +# CHECK: callq __asan_report_store8@PLT +# CHECK: leaq 128(%rsp), %rsp # # CHECK-NEXT: movq %rbx, (%rcx) # # CHECK-NEXT: leaq -128(%rsp), %rsp -# CHECK-NEXT: pushq %rdi -# CHECK-NEXT: leaq (%rdx), %rdi -# CHECK-NEXT: callq __sanitizer_sanitize_store8@PLT -# CHECK-NEXT: popq %rdi -# CHECK-NEXT: leaq 128(%rsp), %rsp +# CHECK: callq __asan_report_store8@PLT +# CHECK: leaq 128(%rsp), %rsp # # CHECK-NEXT: movq %rax, (%rdx) swap: # @swap diff --git a/test/Instrumentation/AddressSanitizer/X86/lit.local.cfg b/test/Instrumentation/AddressSanitizer/X86/lit.local.cfg index ba763cf..e71f3cc 100644 --- a/test/Instrumentation/AddressSanitizer/X86/lit.local.cfg +++ b/test/Instrumentation/AddressSanitizer/X86/lit.local.cfg @@ -1,4 +1,3 @@ -targets = set(config.root.targets_to_build.split()) -if not 'X86' in targets: +if not 'X86' in config.root.targets: config.unsupported = True |