Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / unpoison_string.cpp
blob84d952833539edec035d1be0839d61e9ae1c837e
1 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O0 %s -o %t
2 // RUN: %run %t
3 // RUN: %clangxx_msan -fsanitize-memory-track-origins -O3 %s -o %t
4 // RUN: %run %t
6 #include <assert.h>
7 #include <string.h>
8 #include <sanitizer/msan_interface.h>
10 int main(int argc, char **argv) {
11 char s[20] = "string";
12 __msan_poison(s, sizeof(s));
13 __msan_unpoison_string(s);
14 assert(__msan_test_shadow(s, sizeof(s)) == strlen("string") + 1);
15 return 0;