diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2014-11-06 22:49:13 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2014-11-06 22:49:13 +0000 |
| commit | 8ef50bf3d1c287b5013c3168de77a462dfce3495 (patch) | |
| tree | 3467f3372c1195b1546172d89af2205a50b1866d /lib/msan/lit_tests/Linux/glob_nomatch.cc | |
| parent | 11023dc647fd8f41418da90d59db138400d0f334 (diff) | |
Notes
Diffstat (limited to 'lib/msan/lit_tests/Linux/glob_nomatch.cc')
| -rw-r--r-- | lib/msan/lit_tests/Linux/glob_nomatch.cc | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/msan/lit_tests/Linux/glob_nomatch.cc b/lib/msan/lit_tests/Linux/glob_nomatch.cc new file mode 100644 index 000000000000..0262034aec5b --- /dev/null +++ b/lib/msan/lit_tests/Linux/glob_nomatch.cc @@ -0,0 +1,21 @@ +// RUN: %clangxx_msan -m64 -O0 %s -o %t && %t %p +// RUN: %clangxx_msan -m64 -O3 %s -o %t && %t %p + +#include <assert.h> +#include <glob.h> +#include <stdio.h> +#include <stdlib.h> + +int main(int argc, char *argv[]) { + assert(argc == 2); + char buf[1024]; + snprintf(buf, sizeof(buf), "%s/%s", argv[1], "glob_test_root/*c"); + + glob_t globbuf; + int res = glob(buf, 0, 0, &globbuf); + assert(res == GLOB_NOMATCH); + assert(globbuf.gl_pathc == 0); + if (globbuf.gl_pathv == 0) + exit(0); + return 0; +} |
