Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trans: Only instantiate #[inline] functions in codegen units referencing them #36524

Merged
merged 4 commits into from
Sep 21, 2016
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Adapt run-make/sep-comp-inlining test case to new behaviour
  • Loading branch information
michaelwoerister committed Sep 15, 2016
commit 928c3981b63e63307a020e99ae67474a75652588
13 changes: 7 additions & 6 deletions src/test/run-make/sepcomp-inlining/Makefile
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
-include ../tools.mk

# Test that #[inline(always)] functions still get inlined across compilation
# unit boundaries. Compilation should produce three IR files, with each one
# containing a definition of the inlined function. Also, the non-#[inline]
# function should be defined in only one compilation unit.
# 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
[ "$$(cat "$(TMPDIR)"/foo.?.ll | grep -c define\ i32\ .*inlined)" -eq "1" ]
[ "$$(cat "$(TMPDIR)"/foo.?.ll | grep -c define\ available_externally\ i32\ .*inlined)" -eq "2" ]
[ "$$(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\ i32\ .*normal)" -eq "1" ]
[ "$$(cat "$(TMPDIR)"/foo.?.ll | grep -c declare\ i32\ .*normal)" -eq "2" ]