]> git.proxmox.com Git - rustc.git/blame - src/compiler-rt/test/msan/rand_r.cc
New upstream version 1.19.0+dfsg3
[rustc.git] / src / compiler-rt / test / msan / rand_r.cc
CommitLineData
92a42be0
SL
1// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
2// RUN: %clangxx_msan -O0 -g -DUNINIT %s -o %t && not %run %t 2>&1 | FileCheck %s
1a4d82fc
JJ
3
4#include <assert.h>
5#include <stdio.h>
6#include <stdlib.h>
7
8int main(void) {
9 unsigned seed;
10#ifndef UNINIT
11 seed = 42;
12#endif
13 int v = rand_r(&seed);
14 // CHECK: MemorySanitizer: use-of-uninitialized-value
15 // CHECK: in main{{.*}}rand_r.cc:[[@LINE-2]]
16 if (v) printf(".\n");
17 return 0;
18}