diff options
| author | Stuart Pernsteiner <spernsteiner@mozilla.com> | 2014-08-08 11:24:44 -0700 |
|---|---|---|
| committer | Stuart Pernsteiner <spernsteiner@mozilla.com> | 2014-08-08 11:26:21 -0700 |
| commit | 0c158b4fbfcec7d6f18859661047dff2109fdfe4 (patch) | |
| tree | 54244a6ade6aebedbde01353d7aa30e0c44fc772 /src/test/run-make | |
| parent | 67a05bd793328d33c7fd7b01e0e4d656e1bbe450 (diff) | |
| download | rust-0c158b4fbfcec7d6f18859661047dff2109fdfe4.tar.gz rust-0c158b4fbfcec7d6f18859661047dff2109fdfe4.zip | |
don't translate items when monomorphizing foreign-ABI functions
Diffstat (limited to 'src/test/run-make')
| -rw-r--r-- | src/test/run-make/issue-7349/Makefile | 6 | ||||
| -rw-r--r-- | src/test/run-make/issue-7349/foo.rs | 9 |
2 files changed, 12 insertions, 3 deletions
diff --git a/src/test/run-make/issue-7349/Makefile b/src/test/run-make/issue-7349/Makefile index 18ba80a712d..7f715a475be 100644 --- a/src/test/run-make/issue-7349/Makefile +++ b/src/test/run-make/issue-7349/Makefile @@ -2,10 +2,10 @@ # Test to make sure that inner functions within a polymorphic outer function # don't get re-translated when the outer function is monomorphized. The test -# code monomorphizes the outer function several times, but the magic constant -# `8675309` used in the inner function should appear only once in the generated -# IR. +# code monomorphizes the outer functions several times, but the magic constants +# used in the inner functions should each appear only once in the generated IR. all: $(RUSTC) foo.rs --emit=ir [ "$$(grep -c 8675309 "$(TMPDIR)/foo.ll")" -eq "1" ] + [ "$$(grep -c 11235813 "$(TMPDIR)/foo.ll")" -eq "1" ] diff --git a/src/test/run-make/issue-7349/foo.rs b/src/test/run-make/issue-7349/foo.rs index 775b7314841..870d1749278 100644 --- a/src/test/run-make/issue-7349/foo.rs +++ b/src/test/run-make/issue-7349/foo.rs @@ -15,7 +15,16 @@ fn outer<T>() { } } +extern "C" fn outer_foreign<T>() { + #[allow(dead_code)] + fn inner() -> uint { + 11235813 + } +} + fn main() { outer::<int>(); outer::<uint>(); + outer_foreign::<int>(); + outer_foreign::<uint>(); } |
