// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
+// __asan_default_options() are not supported on Windows.
+// XFAIL: win32
+
const char *kAsanDefaultOptions="verbosity=1 foo=bar";
extern "C"
// Check that free hook doesn't conflict with Realloc.
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
+
+// Malloc/free hooks are not supported on Windows.
+// XFAIL: win32
+
#include <stdlib.h>
#include <unistd.h>
// RUN: env ASAN_OPTIONS=log_path=%t.log %run %t ARG ARG ARG
// RUN: not cat %t.log.*
+// FIXME: log_path is not supported on Windows yet.
+// XFAIL: win32
#include <stdlib.h>
#include <string.h>
// CHECK-Linux-NEXT: #0 0x{{.*}} in operator delete[]
// CHECK-Darwin: freed by thread T{{.*}} here:
// CHECK-Darwin-NEXT: #0 0x{{.*}} in wrap__ZdaPv
+ // CHECK-Windows: freed by thread T{{.*}} here:
+ // CHECK-Windows-NEXT: #0 0x{{.*}} in operator delete[]
// CHECK-NOT: #1 0x{{.*}}
// CHECK-Linux: previously allocated by thread T{{.*}} here:
// CHECK-Linux-NEXT: #0 0x{{.*}} in operator new[]
// CHECK-Darwin: previously allocated by thread T{{.*}} here:
// CHECK-Darwin-NEXT: #0 0x{{.*}} in wrap__Znam
+ // CHECK-Windows: previously allocated by thread T{{.*}} here:
+ // CHECK-Windows-NEXT: #0 0x{{.*}} in operator new[]
// CHECK-NOT: #1 0x{{.*}}
// CHECK: SUMMARY: AddressSanitizer: heap-use-after-free
// RUN: %clangxx_asan -O2 %s -o %t
// RUN: %run %t 2>&1 | FileCheck %s
+
+// Malloc/free hooks are not supported on Windows.
+// XFAIL: win32
+
#include <stdlib.h>
#include <unistd.h>
// RUN: %clangxx_asan -O2 %s -o %t && not %run %t 2>&1 | FileCheck %s
+// FIXME: __asan_on_error() is not supported on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
#include <stdlib.h>
// RUN: %run %t 2>&1 | FileCheck %s
#include <stdio.h>
+#if defined(_WIN32)
+# define snprintf _snprintf
+#endif
+
int main() {
volatile char c = '0';
volatile int x = 12;
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// FIXME: printf is not intercepted on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
// RUN: env ASAN_OPTIONS=check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// FIXME: printf is not intercepted on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
int main() {
volatile char c = '0';
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0:check_printf=1 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
// RUN: env ASAN_OPTIONS=replace_str=0:replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// FIXME: printf is not intercepted on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
int main() {
volatile char c = '0';
// RUN: env ASAN_OPTIONS=replace_intrin=0:check_printf=0 %run %t 2>&1 | FileCheck --check-prefix=CHECK-OFF %s
// RUN: env ASAN_OPTIONS=replace_intrin=0 not %run %t 2>&1 | FileCheck --check-prefix=CHECK-ON %s
+// FIXME: printf is not intercepted on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
#include <string.h>
int main() {
int x = copy[4 + argc]; // BOOM
// CHECK: AddressSanitizer: heap-buffer-overflow
// CHECK: #0 {{.*}}main {{.*}}strdup_oob_test.cc:[[@LINE-2]]
- // CHECK: allocated by thread T{{.*}} here:
- // CHECK: #0 {{.*}}strdup
+ // CHECK-LABEL: allocated by thread T{{.*}} here:
+ // CHECK: #{{[01]}} {{.*}}strdup
+ // CHECK-LABEL: SUMMARY
// CHECK: strdup_oob_test.cc:[[@LINE-6]]
return x;
}
// Android builds with static libstdc++ by default.
// XFAIL: android
+// Clang doesn't support exceptions on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
static volatile int zero = 0;
inline void pretend_to_do_something(void *x) {
// RUN: %clangxx_asan -O %s -o %t && %run %t
+// Clang doesn't support exceptions on Windows yet.
+// XFAIL: win32
+
#include <assert.h>
#include <setjmp.h>
#include <stdlib.h>
// RUN: %clangxx_asan %s -o %t && %run %t
// RUN: %clangxx_asan %s -o %t -static-libstdc++ && %run %t
+
+// Clang doesn't support exceptions on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
static volatile int zero = 0;
inline void pretend_to_do_something(void *x) {
// Test the time() interceptor.
+// There's no interceptor for time() on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
// export ASAN_OPTIONS=detect_stack_use_after_return=1
// RUN: %clangxx_asan -O0 %s -o %t && %run %t
+// Clang doesn't support exceptions on Windows yet.
+// XFAIL: win32
+
#include <stdio.h>
volatile char *g;