Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git] / compiler-rt / test / msan / getutent.cpp
blobb57101068dddfa9b5941ed3e8211f82c2a286f47
1 // RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
3 #ifndef __FreeBSD__
4 #include <utmp.h>
5 #endif
6 #include <utmpx.h>
7 #include <sanitizer/msan_interface.h>
9 int main(void) {
10 #ifndef __FreeBSD__
11 setutent();
12 while (struct utmp *ut = getutent())
13 __msan_check_mem_is_initialized(ut, sizeof(*ut));
14 endutent();
15 #endif
17 setutxent();
18 while (struct utmpx *utx = getutxent())
19 __msan_check_mem_is_initialized(utx, sizeof(*utx));
20 endutxent();