about summary refs log tree commit diff
path: root/src/test/run-make-fulldeps/emit-stack-sizes/Makefile
blob: c2f643ce24c41df18ef382784634ec0d5a68ac9c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
-include ../tools.mk

# This feature only works when the output object format is ELF so we ignore
# macOS and Windows
ifdef IS_WINDOWS
# Do nothing on Windows.
all:
	exit 0
else ifneq (,$(filter $(TARGET),i686-apple-darwin x86_64-apple-darwin))
# Do nothing on macOS.
all:
	exit 0
else
# check that the .stack_sizes section is generated
# this test requires LLVM >= 6.0.0
vers = $(shell $(RUSTC) -Vv)
ifneq (,$(findstring LLVM version: 3,$(vers)))
all:
	exit 0
else ifneq (,$(findstring LLVM version: 4,$(vers)))
all:
	exit 0
else ifneq (,$(findstring LLVM version: 5,$(vers)))
all:
	exit 0
else
all:
	$(RUSTC) -C opt-level=3 -Z emit-stack-sizes --emit=obj foo.rs
	size -A $(TMPDIR)/foo.o | $(CGREP) .stack_sizes
endif
endif