summaryrefslogtreecommitdiffstats
path: root/tests/run-make/comment-section/Makefile
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/run-make/comment-section/Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/run-make/comment-section/Makefile b/tests/run-make/comment-section/Makefile
new file mode 100644
index 000000000..9f810063c
--- /dev/null
+++ b/tests/run-make/comment-section/Makefile
@@ -0,0 +1,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