[RISCV] Add RVVConstraint to SiFive custom matrix multiply instructions. (#124055)
[llvm-project.git] / compiler-rt / test / asan / TestCases / Windows / dll_thread_stack_array_left_oob.cpp
blob78f651b6b9176a82096917d4cd7b1b8fbabd3ef1
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 <windows.h>
6 #include <malloc.h>
8 DWORD WINAPI thread_proc(void *context) {
9 int subscript = -1;
10 char stack_buffer[42];
11 stack_buffer[subscript] = 42;
12 // CHECK: AddressSanitizer: stack-buffer-underflow on address [[ADDR:0x[0-9a-f]+]]
13 // CHECK: WRITE of size 1 at [[ADDR]] thread T1
14 // CHECK-NEXT: thread_proc{{.*}}dll_thread_stack_array_left_oob.cpp:[[@LINE-3]]
16 // CHECK: Address [[ADDR]] is located in stack of thread T1 at offset [[OFFSET:.*]] in frame
17 // CHECK-NEXT: thread_proc{{.*}}dll_thread_stack_array_left_oob.cpp
19 // CHECK: 'stack_buffer'{{.*}} <== Memory access at offset [[OFFSET]] underflows this variable
21 return 0;
24 extern "C" __declspec(dllexport)
25 int test_function() {
26 HANDLE thr = CreateThread(NULL, 0, thread_proc, NULL, 0, NULL);
27 // CHECK-LABEL: Thread T1 created by T0 here:
28 // CHECK: test_function{{.*}}dll_thread_stack_array_left_oob.cpp:[[@LINE-2]]
29 // CHECK-NEXT: main{{.*}}dll_host.cpp
30 // CHECK-LABEL: SUMMARY
31 if (thr == 0)
32 return 1;
33 if (WAIT_OBJECT_0 != WaitForSingleObject(thr, INFINITE))
34 return 2;
35 return 0;