Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / strcmp.c
blob42776af970a6aa3c8ba73f89f27a90310b1af6ce
1 // RUN: %clang_msan %s -o %t
2 // RUN: MSAN_OPTIONS=intercept_strcmp=false %run %t 2>&1
3 // RUN: MSAN_OPTIONS=intercept_strcmp=true not %run %t 2>&1 | FileCheck %s
4 // RUN: not %run %t 2>&1 | FileCheck %s
6 #include <assert.h>
7 #include <stdlib.h>
8 #include <string.h>
10 int main(int argc, char **argv) {
11 char undef;
12 char s1[] = "abcd";
13 char s2[] = "1234";
14 assert(strcmp(s1, s2) > 0);
15 s2[0] = undef;
16 assert(strcmp(s1, s2));
18 // CHECK: {{.*WARNING: MemorySanitizer: use-of-uninitialized-value}}
19 return 0;