Home | History | Annotate | Download | only in msan
      1 // RUN: %clangxx_msan -O0 %s -o %t && %run %t
      2 // RUN: %clangxx_msan -O1 %s -o %t && %run %t
      3 // RUN: %clangxx_msan -O2 %s -o %t && %run %t
      4 // RUN: %clangxx_msan -O3 %s -o %t && %run %t
      5 
      6 // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t
      7 // RUN: %clangxx_msan -O1 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t
      8 // RUN: %clangxx_msan -O2 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t
      9 // RUN: %clangxx_msan -O3 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t
     10 
     11 // Test that readdir64 is intercepted as well as readdir.
     12 
     13 #include <sys/types.h>
     14 #include <dirent.h>
     15 #include <stdlib.h>
     16 
     17 
     18 int main(void) {
     19   DIR *dir = opendir(".");
     20   struct dirent *d = readdir(dir);
     21   if (d->d_name[0]) {
     22     closedir(dir);
     23     exit(0);
     24   }
     25   closedir(dir);
     26   return 0;
     27 }
     28