22 lines · cpp
1// RUN: %clangxx_msan -O0 %s -o %t && %run %t %p2// RUN: %clangxx_msan -O3 %s -o %t && %run %t %p3 4#include <assert.h>5#include <glob.h>6#include <stdio.h>7#include <stdlib.h>8 9int main(int argc, char *argv[]) {10 assert(argc == 2);11 char buf[1024];12 snprintf(buf, sizeof(buf), "%s/%s", argv[1], "glob_test_root/*c");13 14 glob_t globbuf;15 int res = glob(buf, 0, 0, &globbuf);16 assert(res == GLOB_NOMATCH);17 assert(globbuf.gl_pathc == 0);18 if (globbuf.gl_pathv == 0)19 exit(0);20 return 0;21}22