28 lines · cpp
1// RUN: %clangxx_msan -O0 %s -o %t && %run %t2// RUN: %clangxx_msan -O1 %s -o %t && %run %t3// RUN: %clangxx_msan -O2 %s -o %t && %run %t4// RUN: %clangxx_msan -O3 %s -o %t && %run %t5 6// RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t7// RUN: %clangxx_msan -O1 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t8// RUN: %clangxx_msan -O2 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t9// RUN: %clangxx_msan -O3 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t10 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 18int 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