Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / getloadavg.cpp
blob7facd580daf01758a7a63a9992edfb98e73e7aa7
1 // RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
3 #define _BSD_SOURCE
4 #include <assert.h>
5 #include <stdlib.h>
7 #include <sanitizer/msan_interface.h>
9 int main(void) {
10 double x[4];
11 int ret = getloadavg(x, 3);
12 assert(ret > 0);
13 assert(ret <= 3);
14 assert(__msan_test_shadow(x, sizeof(double) * ret) == -1);
15 assert(__msan_test_shadow(&x[ret], sizeof(double)) == 0);