Files
clang-p2996/compiler-rt/test/msan/rand_r.cpp
Fangrui Song d21b3d346a compiler-rt: Rename .cc file in test/msan to .cpp
Like r367463, but for test/msan.

llvm-svn: 367653
2019-08-02 06:07:05 +00:00

19 lines
428 B
C++

// 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;
}