1 // RUN: %clangxx_msan -O0 -g %s -o %t && %run %t
2 // RUN: %clangxx_msan -O3 -g %s -o %t && %run %t
6 #include <sound/asound.h>
10 #include <sys/socket.h>
13 #include <sanitizer/msan_interface.h>
15 int main(int argc
, char **argv
) {
16 int fd
= open("/dev/snd/controlC0", O_RDONLY
);
18 printf("Unable to open sound device.");
21 const unsigned sz
= sizeof(snd_ctl_card_info
);
22 void *info
= malloc(sz
+ 1);
23 assert(__msan_test_shadow(info
, sz
) == 0);
24 assert(ioctl(fd
, SNDRV_CTL_IOCTL_CARD_INFO
, info
) >= 0);
25 assert(__msan_test_shadow(info
, sz
+ 1) == sz
);