summaryrefslogtreecommitdiffstats
path: root/clang/test/Frontend/absolute-paths.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Frontend/absolute-paths.c')
-rw-r--r--clang/test/Frontend/absolute-paths.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/test/Frontend/absolute-paths.c b/clang/test/Frontend/absolute-paths.c
new file mode 100644
index 00000000000..478216294ae
--- /dev/null
+++ b/clang/test/Frontend/absolute-paths.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -fsyntax-only -I %S/Inputs/SystemHeaderPrefix/.. %s 2>&1 | FileCheck -check-prefix=NORMAL -check-prefix=CHECK %s
+// RUN: %clang_cc1 -fsyntax-only -I %S/Inputs/SystemHeaderPrefix/.. -fdiagnostics-absolute-paths %s 2>&1 | FileCheck -check-prefix=ABSOLUTE -check-prefix=CHECK %s
+
+#include "absolute-paths.h"
+
+// Check whether the diagnostic from the header above includes the dummy
+// directory in the path.
+// NORMAL: SystemHeaderPrefix
+// ABSOLUTE-NOT: SystemHeaderPrefix
+// CHECK: warning: control reaches end of non-void function
+
+
+// For files which don't exist, just print the filename.
+#line 123 "non-existant.c"
+int g() {}
+// NORMAL: non-existant.c:123:10: warning: control reaches end of non-void function
+// ABSOLUTE: non-existant.c:123:10: warning: control reaches end of non-void function
OpenPOWER on IntegriCloud