rustc/tests/run-make/comment-section/Makefile
2024-05-27 22:45:50 +02:00

16 lines
493 B
Makefile

include ../tools.mk
# only-linux
all:
echo 'fn main(){}' | $(RUSTC) - --emit=link,obj -Csave-temps --target=$(TARGET)
# Check linked output has a `.comment` section with the expected content.
readelf -p '.comment' $(TMPDIR)/rust_out | $(CGREP) -F 'rustc version 1.'
# Check all object files (including temporary outputs) have a `.comment`
# section with the expected content.
set -e; for f in $(TMPDIR)/*.o; do \
readelf -p '.comment' $$f | $(CGREP) -F 'rustc version 1.'; \
done