summaryrefslogtreecommitdiffstats
path: root/clang/test/Driver/cl-options.c
diff options
context:
space:
mode:
authorHans Wennborg <hans@hanshq.net>2017-01-27 17:09:41 +0000
committerHans Wennborg <hans@hanshq.net>2017-01-27 17:09:41 +0000
commit091f1b6ef314d4e0e37eaf438c63c307253e8b42 (patch)
tree3ed04ff4b9d8da7420eef6f681c6653231322620 /clang/test/Driver/cl-options.c
parent33dc45470026c0619c3d80f95f55af330a15c3cc (diff)
downloadbcm5719-llvm-091f1b6ef314d4e0e37eaf438c63c307253e8b42.tar.gz
bcm5719-llvm-091f1b6ef314d4e0e37eaf438c63c307253e8b42.zip
clang-cl: Warn about /U flags that look like filenames (PR31662)
Both on Mac and Windows, it's common to have a 'Users' directory in the root of the filesystem, so one might specify a filename as '/Users/me/myfile.c'. clang-cl (as well as MSVC's cl.exe) will interpret that as invoking the '/U' option, which is probably not what the user wanted. Add a warning about this. Differential Revision: https://reviews.llvm.org/D29198 llvm-svn: 293305
Diffstat (limited to 'clang/test/Driver/cl-options.c')
-rw-r--r--clang/test/Driver/cl-options.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/test/Driver/cl-options.c b/clang/test/Driver/cl-options.c
index 69238227c54..232cdce1078 100644
--- a/clang/test/Driver/cl-options.c
+++ b/clang/test/Driver/cl-options.c
@@ -442,6 +442,12 @@
// Xclang: "-cc1"
// Xclang: "hellocc1"
+// Files under /Users are often confused with the /U flag. (This could happen
+// for other flags too, but this is the one people run into.)
+// RUN: %clang_cl /c /Users/me/myfile.c -### 2>&1 | FileCheck -check-prefix=SlashU %s
+// SlashU: warning: '/Users/me/myfile.c' treated as the '/U' option
+// SlashU: note: Use '--' to treat subsequent arguments as filenames
+
// RTTI is on by default. /GR- controls -fno-rtti-data.
// RUN: %clang_cl /c /GR- -### -- %s 2>&1 | FileCheck -check-prefix=NoRTTI %s
// NoRTTI: "-fno-rtti-data"
OpenPOWER on IntegriCloud