about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMichael Woerister <michaelwoerister@posteo>2019-04-30 17:38:01 +0200
committerMichael Woerister <michaelwoerister@posteo>2019-04-30 17:38:01 +0200
commit7c4cc01f7900f66be8bc939ddb4fb15636f598f1 (patch)
tree250ac343952d67bb161a82b9410eb4ee40dd91fd
parent7acead5e0a111419593267d37a5615ff4c3b5e4f (diff)
downloadrust-7c4cc01f7900f66be8bc939ddb4fb15636f598f1.tar.gz
rust-7c4cc01f7900f66be8bc939ddb4fb15636f598f1.zip
Work around missing tac command on macOS in PGO run-make test.
-rw-r--r--src/test/run-make-fulldeps/pgo-use/Makefile10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/test/run-make-fulldeps/pgo-use/Makefile b/src/test/run-make-fulldeps/pgo-use/Makefile
index ac61c97dfc5..ababd45d33e 100644
--- a/src/test/run-make-fulldeps/pgo-use/Makefile
+++ b/src/test/run-make-fulldeps/pgo-use/Makefile
@@ -23,6 +23,14 @@ ifdef IS_MSVC
 COMMON_FLAGS+= -Cpanic=abort
 endif
 
+ifeq ($(UNAME),Darwin)
+# macOS does not have the `tac` command, but `tail -r` does the same thing
+TAC := tail -r
+else
+# some other platforms don't support the `-r` flag for `tail`, so use `tac`
+TAC := tac
+endif
+
 all:
 	# Compile the test program with instrumentation
 	$(RUSTC) $(COMMON_FLAGS) -Z pgo-gen="$(TMPDIR)" main.rs
@@ -40,4 +48,4 @@ all:
 	# line with the function name before the line with the function attributes.
 	# FileCheck only supports checking that something matches on the next line,
 	# but not if something matches on the previous line.
-	tac "$(TMPDIR)"/main.ll | "$(LLVM_FILECHECK)" filecheck-patterns.txt
+	$(TAC) "$(TMPDIR)"/main.ll | "$(LLVM_FILECHECK)" filecheck-patterns.txt