about summary refs log tree commit diff
path: root/tests/run-make/comment-section/Makefile
blob: 9f810063cc86daa00ab084e481c1fa184ef3a49a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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