summaryrefslogtreecommitdiffstats
path: root/compiler-rt/test/msan/rand_r.cpp
diff options
context:
space:
mode:
authorFangrui Song <maskray@google.com>2019-08-02 06:07:05 +0000
committerFangrui Song <maskray@google.com>2019-08-02 06:07:05 +0000
commitd21b3d346af2f6189638d853182e389555e7ccb9 (patch)
treeef89086fd1492736105e73e06b3623df3b01df45 /compiler-rt/test/msan/rand_r.cpp
parent6db8c59f210af60d882f7aedc7c9dc95d41d9696 (diff)
downloadbcm5719-llvm-d21b3d346af2f6189638d853182e389555e7ccb9.tar.gz
bcm5719-llvm-d21b3d346af2f6189638d853182e389555e7ccb9.zip
compiler-rt: Rename .cc file in test/msan to .cpp
Like r367463, but for test/msan. llvm-svn: 367653
Diffstat (limited to 'compiler-rt/test/msan/rand_r.cpp')
-rw-r--r--compiler-rt/test/msan/rand_r.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/compiler-rt/test/msan/rand_r.cpp b/compiler-rt/test/msan/rand_r.cpp
new file mode 100644
index 00000000000..d83c43a6d85
--- /dev/null
+++ b/compiler-rt/test/msan/rand_r.cpp
@@ -0,0 +1,18 @@
+// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
+// RUN: %clangxx_msan -O0 -g -DUNINIT %s -o %t && not %run %t 2>&1 | FileCheck %s
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+int main(void) {
+ unsigned seed;
+#ifndef UNINIT
+ seed = 42;
+#endif
+ int v = rand_r(&seed);
+ // CHECK: MemorySanitizer: use-of-uninitialized-value
+ // CHECK: in main{{.*}}rand_r.cpp:[[@LINE-2]]
+ if (v) printf(".\n");
+ return 0;
+}
OpenPOWER on IntegriCloud