Files
clang-p2996/compiler-rt/test/asan/TestCases/frexpl_interceptor.cpp
Alvin Wong 5888a47914 [asan][test] Fix tests or mark XFAIL for MinGW target
After this change, `check-asan-dynamic` should pass on x86_64 MinGW
target, using the llvm-mingw toolchain.

The following is a list of issues fixed:

* `asan_str_test.cpp`: Exclude unintercepted functions on MinGW.
* `asan_test.cpp`: Work around regex limitation of gtest on Windows,
  which only affects MinGW target because `long double` has different
  size to `double`.
* `TestCases/Windows/report_after_syminitialize.cpp`: Added  build
  command specifically for MinGW.
* Other tests: Mark XFAIL for various reasons. Some of them need
  further investigation.

Differential Revision: https://reviews.llvm.org/D147059
2023-04-02 01:06:15 +08:00

21 lines
492 B
C++

// RUN: %clangxx_asan -O0 %s -o %t && not %run %t 2>&1 | FileCheck %s
// Test the frexpl() interceptor.
// FIXME: MinGW-w64 implements `frexpl()` as a static import, so the dynamic
// interceptor seems to not work.
// XFAIL: target={{.*-windows-gnu}}
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
int main() {
long double x = 3.14;
int *exp = (int *)malloc(sizeof(int));
free(exp);
double y = frexpl(x, exp);
// CHECK: use-after-free
// CHECK: SUMMARY
return 0;
}