diff options
| author | Eli Friedman <eli.friedman@gmail.com> | 2011-07-08 20:17:28 +0000 |
|---|---|---|
| committer | Eli Friedman <eli.friedman@gmail.com> | 2011-07-08 20:17:28 +0000 |
| commit | f7ca26a077719d478788c401288d9181eb636984 (patch) | |
| tree | 41d2b430f321efab714220cfd33c8593f730b710 /clang/test/Frontend/dependency-gen.c | |
| parent | 166cd8864589db8c0659bfc020536380ab95089e (diff) | |
| download | bcm5719-llvm-f7ca26a077719d478788c401288d9181eb636984.tar.gz bcm5719-llvm-f7ca26a077719d478788c401288d9181eb636984.zip | |
Fix up dependency file name printing to more closely match that of gcc, including fixing a nasty recent regression that could make us print "/foo.h" with a command-line including "-I ./".
rdar://problem/9734352
llvm-svn: 134728
Diffstat (limited to 'clang/test/Frontend/dependency-gen.c')
| -rw-r--r-- | clang/test/Frontend/dependency-gen.c | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/clang/test/Frontend/dependency-gen.c b/clang/test/Frontend/dependency-gen.c index 0f8adabc85a..49d3f28614c 100644 --- a/clang/test/Frontend/dependency-gen.c +++ b/clang/test/Frontend/dependency-gen.c @@ -1,19 +1,27 @@ -// rdar://6533411 -// RUN: %clang -MD -MF %t.d -S -x c -o %t.o %s -// RUN: grep '.*dependency-gen.*:' %t.d -// RUN: grep 'dependency-gen.c' %t.d - -// RUN: %clang -S -M -x c %s -o %t.d -// RUN: grep '.*dependency-gen.*:' %t.d -// RUN: grep 'dependency-gen.c' %t.d - -// PR8974 // REQUIRES: shell -// "cd %t.dir" requires shell. +// Basic test // RUN: rm -rf %t.dir // RUN: mkdir -p %t.dir/a/b // RUN: echo > %t.dir/a/b/x.h // RUN: cd %t.dir -// RUN: %clang -include a/b/x.h -MD -MF %t.d -S -x c -o %t.o %s -// RUN: grep ' a/b/x\.h' %t.d +// RUN: %clang -MD -MF - %s -fsyntax-only -I a/b | FileCheck -check-prefix=CHECK-ONE %s +// CHECK-ONE: {{ }}a/b/x.h + +// PR8974 (-include flag) +// RUN: %clang -MD -MF - %s -fsyntax-only -include a/b/x.h -DINCLUDE_FLAG_TEST | FileCheck -check-prefix=CHECK-TWO %s +// CHECK-TWO: {{ }}a/b/x.h + +// rdar://problem/9734352 (paths involving ".") +// RUN: %clang -MD -MF - %s -fsyntax-only -I ./a/b | FileCheck -check-prefix=CHECK-THREE %s +// CHECK-THREE: {{ }}a/b/x.h +// RUN: %clang -MD -MF - %s -fsyntax-only -I .//./a/b/ | FileCheck -check-prefix=CHECK-FOUR %s +// CHECK-FOUR: {{ }}a/b/x.h +// RUN: %clang -MD -MF - %s -fsyntax-only -I a/b/. | FileCheck -check-prefix=CHECK-FIVE %s +// CHECK-FIVE: {{ }}a/b/./x.h +// RUN: cd a/b +// RUN: %clang -MD -MF - %s -fsyntax-only -I ./ | FileCheck -check-prefix=CHECK-SIX %s +// CHECK-SIX: {{ }}x.h +#ifndef INCLUDE_FLAG_TEST +#include <x.h> +#endif |

