Skip to content

Commit 7c4cc01

Browse files
Work around missing tac command on macOS in PGO run-make test.
1 parent 7acead5 commit 7c4cc01

File tree

1 file changed

+9
-1
lines changed
  • src/test/run-make-fulldeps/pgo-use

1 file changed

+9
-1
lines changed

src/test/run-make-fulldeps/pgo-use/Makefile

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ ifdef IS_MSVC
2323
COMMON_FLAGS+= -Cpanic=abort
2424
endif
2525

26+
ifeq ($(UNAME),Darwin)
27+
# macOS does not have the `tac` command, but `tail -r` does the same thing
28+
TAC := tail -r
29+
else
30+
# some other platforms don't support the `-r` flag for `tail`, so use `tac`
31+
TAC := tac
32+
endif
33+
2634
all:
2735
# Compile the test program with instrumentation
2836
$(RUSTC) $(COMMON_FLAGS) -Z pgo-gen="$(TMPDIR)" main.rs
@@ -40,4 +48,4 @@ all:
4048
# line with the function name before the line with the function attributes.
4149
# FileCheck only supports checking that something matches on the next line,
4250
# but not if something matches on the previous line.
43-
tac "$(TMPDIR)"/main.ll | "$(LLVM_FILECHECK)" filecheck-patterns.txt
51+
$(TAC) "$(TMPDIR)"/main.ll | "$(LLVM_FILECHECK)" filecheck-patterns.txt

0 commit comments

Comments
 (0)