summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/asan/lit_tests/TestCases/time_interceptor.cc
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2013-06-06 09:23:34 +0000
committerAlexey Samsonov <samsonov@google.com>2013-06-06 09:23:34 +0000
commit2874f70250286e581c3b15be0f1f8ad3b9e86aa5 (patch)
tree30f7d3da64697083dc294311eac536d1421bb989 /compiler-rt/lib/asan/lit_tests/TestCases/time_interceptor.cc
parent15439bcf79decf81f94bfaf2e4b39167bf954b18 (diff)
downloadbcm5719-llvm-2874f70250286e581c3b15be0f1f8ad3b9e86aa5.tar.gz
bcm5719-llvm-2874f70250286e581c3b15be0f1f8ad3b9e86aa5.zip
[ASan] move all lit_tests under TestCases
llvm-svn: 183395
Diffstat (limited to 'compiler-rt/lib/asan/lit_tests/TestCases/time_interceptor.cc')
-rw-r--r--compiler-rt/lib/asan/lit_tests/TestCases/time_interceptor.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/lit_tests/TestCases/time_interceptor.cc b/compiler-rt/lib/asan/lit_tests/TestCases/time_interceptor.cc
new file mode 100644
index 00000000000..f5f2ad62b81
--- /dev/null
+++ b/compiler-rt/lib/asan/lit_tests/TestCases/time_interceptor.cc
@@ -0,0 +1,16 @@
+// RUN: %clangxx_asan -m64 -O0 %s -o %t && %t 2>&1 | %symbolize | FileCheck %s
+
+// Test the time() interceptor.
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+int main() {
+ time_t *tm = (time_t*)malloc(sizeof(time_t));
+ free(tm);
+ time_t t = time(tm);
+ printf("Time: %s\n", ctime(&t)); // NOLINT
+ // CHECK: use-after-free
+ return 0;
+}
OpenPOWER on IntegriCloud