summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNico Weber <nicolasweber@gmx.de>2019-07-09 00:36:18 +0000
committerNico Weber <nicolasweber@gmx.de>2019-07-09 00:36:18 +0000
commit9d2538d2dcbafcb2df1a92901a38ed052d844b33 (patch)
tree6b12b289cc7711bd3ae76f05382d5a9ef2a4f3b5
parente3f06b478cfd1560508df17deec02a4a43157759 (diff)
downloadbcm5719-llvm-9d2538d2dcbafcb2df1a92901a38ed052d844b33.tar.gz
bcm5719-llvm-9d2538d2dcbafcb2df1a92901a38ed052d844b33.zip
Use `ln -n` to prevent forming a symlink cycle, instead of rm'ing the source
This is a better fix for the problem fixed in r334972. Also remove the rm'ing of the symlink destination that was there to clean up the bots -- it's over a year later, bots should be happy now. Differential Revision: https://reviews.llvm.org/D64301 llvm-svn: 365414
-rw-r--r--clang/test/Driver/no-canonical-prefixes.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/clang/test/Driver/no-canonical-prefixes.c b/clang/test/Driver/no-canonical-prefixes.c
index 8b9e04410ed..85de9f1d702 100644
--- a/clang/test/Driver/no-canonical-prefixes.c
+++ b/clang/test/Driver/no-canonical-prefixes.c
@@ -1,15 +1,13 @@
// 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
+// If %.fake 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.
+// The `-n` flag prevents this.
+// RUN: ln -sfn %t.real %t.fake
// RUN: cd %t.fake
// RUN: ./test-clang -v -S %s 2>&1 | FileCheck --check-prefix=CANONICAL %s
// RUN: ./test-clang -v -S %s -no-canonical-prefixes 2>&1 | FileCheck --check-prefix=NON-CANONICAL %s
OpenPOWER on IntegriCloud