Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adapt run-make/sep-comp-inlining test case to new behaviour
- Loading branch information
1 parent
c10176e
commit 928c398
Showing
1 changed file
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" ] |