aboutsummaryrefslogtreecommitdiff
path: root/test/sanitizer_common/TestCases/fopen_nullptr.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/sanitizer_common/TestCases/fopen_nullptr.c')
-rw-r--r--test/sanitizer_common/TestCases/fopen_nullptr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/sanitizer_common/TestCases/fopen_nullptr.c b/test/sanitizer_common/TestCases/fopen_nullptr.c
new file mode 100644
index 000000000000..960dda334a61
--- /dev/null
+++ b/test/sanitizer_common/TestCases/fopen_nullptr.c
@@ -0,0 +1,6 @@
+// Check that fopen(NULL, "r") is ok.
+// RUN: %clang -O2 %s -o %t && %run %t
+#include <stdio.h>
+const char *fn = NULL;
+FILE *f;
+int main() { f = fopen(fn, "r"); }