aboutsummaryrefslogtreecommitdiff
path: root/test/asan/TestCases/sleep_after_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/asan/TestCases/sleep_after_init.c')
-rw-r--r--test/asan/TestCases/sleep_after_init.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/asan/TestCases/sleep_after_init.c b/test/asan/TestCases/sleep_after_init.c
new file mode 100644
index 000000000000..147af67c72ea
--- /dev/null
+++ b/test/asan/TestCases/sleep_after_init.c
@@ -0,0 +1,10 @@
+// RUN: %clang_asan -O2 %s -o %t
+// RUN: %env_asan_opts=sleep_after_init=1 not %run %t 2>&1 | FileCheck %s
+
+#include <stdlib.h>
+int main() {
+ // CHECK: Sleeping for 1 second
+ char *x = (char*)malloc(10 * sizeof(char));
+ free(x);
+ return x[5];
+}