| Alexey Samsonov | d06aa3d | 2015-03-02 19:34:27 +0000 | [diff] [blame] | 1 | // RUN: %clangxx_msan -O0 %s -o %t && %run %t %p 2>&1 | FileCheck %s |
| 2 | // RUN: %clangxx_msan -O0 -D_FILE_OFFSET_BITS=64 %s -o %t && %run %t %p 2>&1 | FileCheck %s |
| 3 | // RUN: %clangxx_msan -O3 %s -o %t && %run %t %p 2>&1 | FileCheck %s |
| Evgeniy Stepanov | 69967c2 | 2013-04-09 11:35:13 +0000 | [diff] [blame] | 4 | |
| Evgeniy Stepanov | 69967c2 | 2013-04-09 11:35:13 +0000 | [diff] [blame] | 5 | #include <assert.h> |
| 6 | #include <glob.h> |
| 7 | #include <stdio.h> |
| 8 | #include <string.h> |
| 9 | #include <errno.h> |
| 10 | |
| 11 | int main(int argc, char *argv[]) { |
| 12 | assert(argc == 2); |
| 13 | char buf[1024]; |
| 14 | snprintf(buf, sizeof(buf), "%s/%s", argv[1], "glob_test_root/*a"); |
| 15 | |
| 16 | glob_t globbuf; |
| 17 | int res = glob(buf, 0, 0, &globbuf); |
| 18 | |
| 19 | printf("%d %s\n", errno, strerror(errno)); |
| 20 | assert(res == 0); |
| 21 | assert(globbuf.gl_pathc == 2); |
| 22 | printf("%zu\n", strlen(globbuf.gl_pathv[0])); |
| 23 | printf("%zu\n", strlen(globbuf.gl_pathv[1])); |
| 24 | printf("PASS\n"); |
| 25 | // CHECK: PASS |
| 26 | return 0; |
| 27 | } |