[RISCV] Add RVVConstraint to SiFive custom matrix multiply instructions. (#124055)
[llvm-project.git] / compiler-rt / test / asan / TestCases / Windows / dll_intercept_memset.cpp
blob27b343f439cb55893e7f6a4d3b05ede1f748175e
1 // RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t
2 // RUN: %clang_cl_asan -Wno-fortify-source %LD %Od %s %Fe%t.dll
3 // RUN: not %run %t %t.dll 2>&1 | FileCheck %s
5 // Test that it works correctly even with ICF enabled.
6 // RUN: %clang_cl_asan -Wno-fortify-source %LD %Od %s %Fe%t.dll \
7 // RUN: %if target={{.*-windows-gnu}} %{ -Wl,--gc-sections,--icf=all %} \
8 // RUN: %else %{ -link /OPT:REF /OPT:ICF %}
9 // RUN: not %run %t %t.dll 2>&1 | FileCheck %s
11 #include <stdio.h>
12 #include <string.h>
14 extern "C" __declspec(dllexport)
15 int test_function() {
16 char buff[5] = "aaaa";
18 memset(buff, 'b', 5);
19 if (buff[2] != 'b')
20 return 2;
21 printf("Initial test OK\n");
22 fflush(0);
23 // CHECK: Initial test OK
25 memset(buff, 'c', 6);
26 // CHECK: AddressSanitizer: stack-buffer-overflow on address [[ADDR:0x[0-9a-f]+]]
27 // CHECK: WRITE of size 6 at [[ADDR]] thread T0
28 // CHECK-NEXT: __asan_memset
29 // CHECK-NEXT: test_function {{.*}}dll_intercept_memset.cpp:[[@LINE-4]]
30 // CHECK: Address [[ADDR]] is located in stack of thread T0 at offset {{.*}} in frame
31 // CHECK-NEXT: test_function {{.*}}dll_intercept_memset.cpp
32 // CHECK: 'buff'{{.*}} <== Memory access at offset {{.*}} overflows this variable
33 return 0;