22 lines · cpp
1// RUN: %clangxx_msan -O0 -g %s -o %t && %run %t2 3#ifndef __FreeBSD__4#include <utmp.h>5#endif6#include <utmpx.h>7#include <sanitizer/msan_interface.h>8 9int 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#endif16 17 setutxent();18 while (struct utmpx *utx = getutxent())19 __msan_check_mem_is_initialized(utx, sizeof(*utx));20 endutxent();21}22