summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/sanitizer_common/TestCases/fopen_nullptr.c
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/test/sanitizer_common/TestCases/fopen_nullptr.c')
-rw-r--r--compiler-rt/test/sanitizer_common/TestCases/fopen_nullptr.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler-rt/test/sanitizer_common/TestCases/fopen_nullptr.c b/compiler-rt/test/sanitizer_common/TestCases/fopen_nullptr.c
new file mode 100644
index 00000000000..960dda334a6
--- /dev/null
+++ b/compiler-rt/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"); }
OpenPOWER on IntegriCloud