Skip to content
Browse files

Work around missing tac command on macOS in PGO run-make test.

  • Loading branch information...
michaelwoerister committed Apr 30, 2019
1 parent 7acead5 commit 7c4cc01f7900f66be8bc939ddb4fb15636f598f1
Showing with 9 additions and 1 deletion.
  1. +9 −1 src/test/run-make-fulldeps/pgo-use/Makefile
@@ -23,6 +23,14 @@ ifdef IS_MSVC
COMMON_FLAGS+= -Cpanic=abort

ifeq ($(UNAME),Darwin)
# macOS does not have the `tac` command, but `tail -r` does the same thing
TAC := tail -r
# some other platforms don't support the `-r` flag for `tail`, so use `tac`
TAC := tac

# Compile the test program with instrumentation
$(RUSTC) $(COMMON_FLAGS) -Z pgo-gen="$(TMPDIR)"
@@ -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

0 comments on commit 7c4cc01

Please sign in to comment.
You can’t perform that action at this time.