1 // RUN: %clangxx_msan -O0 %s -o %t && %run %t %p
2 // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p
3 // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p
13 #include <sys/types.h>
17 #include <sanitizer/msan_interface.h>
20 int main(int argc
, char *argv
[]) {
23 snprintf(buf
, sizeof(buf
), "%s/%s", argv
[1], "scandir_test_root/");
26 int res
= scandir(buf
, &d
, NULL
, NULL
);
28 assert(__msan_test_shadow(&d
, sizeof(*d
)) == (size_t)-1);
29 for (int i
= 0; i
< res
; ++i
) {
30 assert(__msan_test_shadow(&d
[i
], sizeof(d
[i
])) == (size_t)-1);
31 assert(__msan_test_shadow(d
[i
], d
[i
]->d_reclen
) == (size_t)-1);