Skip to content

Commit

Permalink
[compiler-rt][asan] Disable a broken test on windows 64-bits
Browse files Browse the repository at this point in the history
Summary:
This test is broken on wndows 64-bit.

The interception library is not able to hook on the memchr functions.

Snippet of the function that is not hookable:
```
--- No source file -------------------------------------------------------------
000007FEFA1A18CD CC                   int         3  
000007FEFA1A18CE CC                   int         3  
000007FEFA1A18CF CC                   int         3  
--- f:\dd\vctools\crt\vcruntime\src\string\amd64_arm_arm64\memchr.c ------------
        while ( cnt && (*(unsigned char *)buf != (unsigned char)chr) ) {
000007FEFA1A18D0 4D 85 C0             test        r8,r8  
000007FEFA1A18D3 74 0D                je          memchr+12h (07FEFA1A18E2h)  
000007FEFA1A18D5 38 11                cmp         byte ptr [rcx],dl  
000007FEFA1A18D7 74 09                je          memchr+12h (07FEFA1A18E2h)  
                buf = (unsigned char *)buf + 1;
000007FEFA1A18D9 48 FF C1             inc         rcx  
                cnt--;
000007FEFA1A18DC 49 83 E8 01          sub         r8,1  
000007FEFA1A18E0 75 F3                jne         memchr+5h (07FEFA1A18D5h)  
        }
```

Reviewers: rnk

Subscribers: kubabrecka, dberris, llvm-commits, chrisha

Differential Revision: https://reviews.llvm.org/D25037

llvm-svn: 282860
  • Loading branch information
bergeret committed Sep 30, 2016
1 parent 04a9eb4 commit cde7836
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -2,6 +2,12 @@
// RUN: %clang_cl_asan -LD -O0 %s -Fe%t.dll
// RUN: not %run %t %t.dll 2>&1 | FileCheck %s

// On windows 64-bit, the memchr function is written in assembly and is not
// hookable with the interception library. There is not enough padding before
// the function and there is a short jump on the second instruction which
// doesn't not allow enough space to encode a 64-bit indirect jump.
// UNSUPPORTED: x86_64-windows

#include <string.h>

extern "C" __declspec(dllexport)
Expand Down

0 comments on commit cde7836

Please sign in to comment.