summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/debug-info-compilation-dir.c4
-rw-r--r--clang/test/Driver/debug.c8
2 files changed, 12 insertions, 0 deletions
diff --git a/clang/test/CodeGen/debug-info-compilation-dir.c b/clang/test/CodeGen/debug-info-compilation-dir.c
new file mode 100644
index 00000000000..4ffa1552cad
--- /dev/null
+++ b/clang/test/CodeGen/debug-info-compilation-dir.c
@@ -0,0 +1,4 @@
+// RUN: %clang_cc1 -fdebug-compilation-dir /nonsense -emit-llvm -g %s -o - | \
+// RUN: grep nonsense
+
+// RUN: %clang_cc1 -emit-llvm -g %s -o - | grep %S
diff --git a/clang/test/Driver/debug.c b/clang/test/Driver/debug.c
new file mode 100644
index 00000000000..2ed8921769f
--- /dev/null
+++ b/clang/test/Driver/debug.c
@@ -0,0 +1,8 @@
+// RUN: %clang -### -g %s -c 2>&1 | grep '"-fdebug-compilation-dir" "'%S'"'
+// RUN: PWD=/foo %clang -### -g %s -c 2>&1 | grep '"-fdebug-compilation-dir" "/foo"'
+
+// This test uses grep instead of FileCheck so that we get %S -> dirname
+// substitution.
+
+// "PWD=/foo gcc" wouldn't necessarily work. You would need to pick a different
+// path to the same directory (try a symlink).
OpenPOWER on IntegriCloud