[ASan/Win tests] Remove the extra 'cat' in front of FileCheck now that it's clear...
[blocksruntime.git] / test / asan / TestCases / Windows / bitfield_uaf.cc
blob63f3941e8a94d625804b071643fde36c6a4c86be
1 // RUN: %clangxx_asan -O0 %s -Fe%t
2 // RUN: not %run %t 2>&1 | FileCheck %s
4 #include <windows.h>
6 typedef struct _S {
7 unsigned int bf1:1;
8 unsigned int bf2:2;
9 unsigned int bf3:3;
10 unsigned int bf4:4;
11 } S;
13 void make_access(S *s) {
14 s->bf2 = 2;
15 // CHECK: AddressSanitizer: heap-use-after-free on address [[ADDR:0x[0-9a-f]+]]
16 // CHECK: READ of size {{[124]}} at [[ADDR]]
17 // CHECK: {{#0 .* make_access .*bitfield_uaf.cc}}:[[@LINE-3]]
18 // CHECK: {{#1 .* main}}
21 int main(void) {
22 S *s = (S*)malloc(sizeof(S));
23 free(s);
24 // CHECK: [[ADDR]] is located 0 bytes inside of 4-byte region
25 // CHECK-LABEL: freed by thread T0 here:
26 // CHECK: {{#0 .* free }}
27 // CHECK: {{#1 .* main .*bitfield_uaf.cc}}:[[@LINE-4]]
28 // CHECK-LABEL: previously allocated by thread T0 here:
29 // CHECK: {{#0 .* malloc }}
30 // CHECK: {{#1 .* main .*bitfield_uaf.cc}}:[[@LINE-8]]
31 make_access(s);
32 return 0;