1// RUN: %clang_cl_asan %s -Fe%t.exe
2// RUN: %run %t.exe | FileCheck %s
3
4// CHECK: Success
5
6#include <malloc.h>
7#include <stdio.h>
8#include <string.h>
9
10int main() {
11 // Null input is valid to strdup on Windows.
12 char *nullStr = _strdup(s: nullptr);
13 free(ptr: nullStr);
14 puts(s: "Success");
15 return 0;
16}
17

source code of compiler-rt/test/asan/TestCases/Windows/msvc/strdup_null_input.cpp