aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2018-06-18 18:50:35 +0000
committerNico Weber <nicolasweber@gmx.de>2018-06-18 18:50:35 +0000
commitec4717bda81827af455efa04c367c168cf1f221c (patch)
treed0d67e045e70bd63caf5d81626858462363e1e38
parent46ac88f786ba30c569c8ab179716d97e020ad2ad (diff)
Don't let test/Driver/no-canonical-prefixes.c form a symlink cycle the second time it runs.
The test makes %t.fake a symlink to %t.real by running `ln -sf %t.real %t.fake`. If %t.fake already is a symlink to %t.real when this runs (e.g. if the test has run before), then this effectively becomes `ln -sf %t.real %t.real`, symlinking the directory to itself. At least on my mac, this leads to the directory containing itself. As fix, just remove %t.fake before creating the symlink. To clean up build dirs on bots, also remove %t.real for a while. https://reviews.llvm.org/D48224 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@334972 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--test/Driver/no-canonical-prefixes.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/Driver/no-canonical-prefixes.c b/test/Driver/no-canonical-prefixes.c
index 7bc76be22d..8b9e04410e 100644
--- a/test/Driver/no-canonical-prefixes.c
+++ b/test/Driver/no-canonical-prefixes.c
@@ -1,9 +1,14 @@
// Due to ln -sf:
// REQUIRES: shell
+// RUN: rm -rf %t.real
// RUN: mkdir -p %t.real
// RUN: cd %t.real
// RUN: ln -sf %clang test-clang
// RUN: cd ..
+// Important to remove %t.fake: If it already is a symlink to %t.real when
+// `ln -sf %t.real %t.fake` runs, then that would symlink %t.real to itself,
+// forming a cycle.
+// RUN: rm -rf %t.fake
// RUN: ln -sf %t.real %t.fake
// RUN: cd %t.fake
// RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s