1 // RUN: %clangxx_asan -O0 %s -o %t && %t %p 2>&1 | FileCheck %s
2 // RUN: %clangxx_asan -O3 %s -o %t && %t %p 2>&1 | FileCheck %s
12 int main(int argc
, char *argv
[]) {
13 std::string path
= argv
[1];
14 std::string pattern
= path
+ "/glob_test_root/*a";
15 printf("pattern: %s\n", pattern
.c_str());
18 int res
= glob(pattern
.c_str(), 0, 0, &globbuf
);
20 printf("%d %s\n", errno
, strerror(errno
));
22 assert(globbuf
.gl_pathc
== 2);
23 printf("%zu\n", strlen(globbuf
.gl_pathv
[0]));
24 printf("%zu\n", strlen(globbuf
.gl_pathv
[1]));