about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJorge Aparicio <jorge@japaric.io>2018-09-13 20:25:58 +0200
committerJorge Aparicio <jorge@japaric.io>2018-09-26 15:21:26 +0200
commitf5bc6782554b7d55678d0ed4256cba4586be4208 (patch)
tree5c165285aa433f45a34e116d41b78090e5615d59
parent39afcd0673cb8fc04944ede0402dd2479bb57300 (diff)
downloadrust-f5bc6782554b7d55678d0ed4256cba4586be4208.tar.gz
rust-f5bc6782554b7d55678d0ed4256cba4586be4208.zip
add run-make test
-rw-r--r--src/test/run-make-fulldeps/emit-stack-sizes/Makefile12
-rw-r--r--src/test/run-make-fulldeps/emit-stack-sizes/foo.rs13
2 files changed, 25 insertions, 0 deletions
diff --git a/src/test/run-make-fulldeps/emit-stack-sizes/Makefile b/src/test/run-make-fulldeps/emit-stack-sizes/Makefile
new file mode 100644
index 00000000000..b6b8113633d
--- /dev/null
+++ b/src/test/run-make-fulldeps/emit-stack-sizes/Makefile
@@ -0,0 +1,12 @@
+-include ../tools.mk
+
+ifdef IS_WINDOWS
+# Do nothing on MSVC.
+all:
+	exit 0
+else
+# check that the .stack_sizes section is generated
+all:
+	$(RUSTC) -C opt-level=3 -Z emit-stack-sizes --emit=obj foo.rs
+	size -A $(TMPDIR)/foo.o | $(CGREP) .stack_sizes
+endif
diff --git a/src/test/run-make-fulldeps/emit-stack-sizes/foo.rs b/src/test/run-make-fulldeps/emit-stack-sizes/foo.rs
new file mode 100644
index 00000000000..6c81b63963a
--- /dev/null
+++ b/src/test/run-make-fulldeps/emit-stack-sizes/foo.rs
@@ -0,0 +1,13 @@
+// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
+
+#![crate_type = "lib"]
+
+pub fn foo() {}