diff options
| author | Michael Woerister <michaelwoerister@posteo> | 2019-04-30 17:38:01 +0200 |
|---|---|---|
| committer | Michael Woerister <michaelwoerister@posteo> | 2019-04-30 17:38:01 +0200 |
| commit | 7c4cc01f7900f66be8bc939ddb4fb15636f598f1 (patch) | |
| tree | 250ac343952d67bb161a82b9410eb4ee40dd91fd | |
| parent | 7acead5e0a111419593267d37a5615ff4c3b5e4f (diff) | |
| download | rust-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/Makefile | 10 |
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 |
