diff options
| author | bors <bors@rust-lang.org> | 2014-08-09 23:26:18 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-08-09 23:26:18 +0000 |
| commit | 351cc4fc99b7579cf53c5dbeb35cfb224ced03d8 (patch) | |
| tree | d4a057da2da3c92625dae6c8614082d9a7fe1240 /src/test | |
| parent | 4136d5f44d739391a60f8e51429dd30f2d96aae8 (diff) | |
| parent | 0c158b4fbfcec7d6f18859661047dff2109fdfe4 (diff) | |
| download | rust-351cc4fc99b7579cf53c5dbeb35cfb224ced03d8.tar.gz rust-351cc4fc99b7579cf53c5dbeb35cfb224ced03d8.zip | |
auto merge of #16359 : epdtry/rust/mono-item-dedup-foreign, r=alexcrichton
Extend the changes from #16059 to the new generic foreign functions introduced by #15831.
Diffstat (limited to 'src/test')
| -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>(); } |
