summaryrefslogtreecommitdiffstats
path: root/tests/run-make-fulldeps/sepcomp-inlining/Makefile
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:19:13 +0000
commit218caa410aa38c29984be31a5229b9fa717560ee (patch)
treec54bd55eeb6e4c508940a30e94c0032fbd45d677 /tests/run-make-fulldeps/sepcomp-inlining/Makefile
parentReleasing progress-linux version 1.67.1+dfsg1-1~progress7.99u1. (diff)
downloadrustc-218caa410aa38c29984be31a5229b9fa717560ee.tar.xz
rustc-218caa410aa38c29984be31a5229b9fa717560ee.zip
Merging upstream version 1.68.2+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/run-make-fulldeps/sepcomp-inlining/Makefile')
-rw-r--r--tests/run-make-fulldeps/sepcomp-inlining/Makefile15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/run-make-fulldeps/sepcomp-inlining/Makefile b/tests/run-make-fulldeps/sepcomp-inlining/Makefile
new file mode 100644
index 000000000..327aeb75e
--- /dev/null
+++ b/tests/run-make-fulldeps/sepcomp-inlining/Makefile
@@ -0,0 +1,15 @@
+include ../tools.mk
+
+# Test that #[inline] functions still get inlined across compilation unit
+# boundaries. Compilation should produce three IR files, but only the two
+# compilation units that have a usage of the #[inline] function should
+# contain a definition. Also, the non-#[inline] function should be defined
+# in only one compilation unit.
+
+all:
+ $(RUSTC) foo.rs --emit=llvm-ir -C codegen-units=3 \
+ -Z inline-in-all-cgus
+ [ "$$(cat "$(TMPDIR)"/foo.*.ll | grep -c define\ i32\ .*inlined)" -eq "0" ]
+ [ "$$(cat "$(TMPDIR)"/foo.*.ll | grep -c define\ internal\ i32\ .*inlined)" -eq "2" ]
+ [ "$$(cat "$(TMPDIR)"/foo.*.ll | grep -c define\ hidden\ i32\ .*normal)" -eq "1" ]
+ [ "$$(cat "$(TMPDIR)"/foo.*.ll | grep -c declare\ hidden\ i32\ .*normal)" -eq "2" ]