[RISCV] Add RVVConstraint to SiFive custom matrix multiply instructions. (#124055)
[llvm-project.git] / compiler-rt / test / asan / TestCases / Windows / dll_intercept_memcpy_indirect.cpp
blob0bdd350ed409bec7ceaa197df7ef2d389aecc304
1 // RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t
2 // RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll
3 // RUN: not %run %t %t.dll 2>&1 | FileCheck %s
5 #include <stdio.h>
6 #include <string.h>
8 void call_memcpy(void* (*f)(void *, const void *, size_t),
9 void *a, const void *b, size_t c) {
10 f(a, b, c);
13 extern "C" __declspec(dllexport)
14 int test_function() {
15 char buff1[6] = "Hello", buff2[5];
17 call_memcpy(&memcpy, buff2, buff1, 5);
18 if (buff1[2] != buff2[2])
19 return 2;
20 printf("Initial test OK\n");
21 fflush(0);
22 // CHECK: Initial test OK
24 call_memcpy(&memcpy, buff2, buff1, 6);
25 // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
26 // CHECK: WRITE of size 6 at [[ADDR]] thread T0
27 // CHECK-NEXT: mem{{.*}}
28 // CHECK-NEXT: call_memcpy
29 // CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy_indirect.cpp:[[@LINE-5]]
30 // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
31 // CHECK-NEXT: test_function {{.*}}dll_intercept_memcpy_indirect.cpp
32 // CHECK: 'buff2'{{.*}} <== Memory access at offset {{.*}} overflows this variable
33 return 0;