21 lines · cpp
1// RUN: %clang_cl_asan %Od %p/dll_host.cpp %Fe%t2// RUN: %clang_cl_asan %LD %Od %s %Fe%t.dll3// RUN: not %run %t %t.dll 2>&1 | FileCheck %s4 5#include "../defines.h"6 7ATTRIBUTE_NOINLINE8static void NullDeref(int *ptr) {9 // CHECK: ERROR: AddressSanitizer: access-violation on unknown address10 // CHECK: {{0x0*000.. .*pc 0x.*}}11 ptr[10]++; // BOOM12}13 14extern "C" __declspec(dllexport)15int test_function() {16 NullDeref((int*)0);17 // CHECK: {{ #1 0x.* in test_function .*\dll_null_deref.cpp:}}[[@LINE-1]]18 // CHECK: AddressSanitizer can not provide additional info.19 return 0;20}21