diff options
Diffstat (limited to 'tests/run-make/symbols-include-type-name')
-rw-r--r-- | tests/run-make/symbols-include-type-name/Makefile | 9 | ||||
-rw-r--r-- | tests/run-make/symbols-include-type-name/lib.rs | 14 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/run-make/symbols-include-type-name/Makefile b/tests/run-make/symbols-include-type-name/Makefile new file mode 100644 index 000000000..ac26a852e --- /dev/null +++ b/tests/run-make/symbols-include-type-name/Makefile @@ -0,0 +1,9 @@ +include ../tools.mk + +# Check that symbol names for methods include type names, instead of <impl>. + +OUT=$(TMPDIR)/lib.s + +all: + $(RUSTC) --crate-type staticlib --emit asm lib.rs + $(CGREP) Def < $(OUT) diff --git a/tests/run-make/symbols-include-type-name/lib.rs b/tests/run-make/symbols-include-type-name/lib.rs new file mode 100644 index 000000000..37d445917 --- /dev/null +++ b/tests/run-make/symbols-include-type-name/lib.rs @@ -0,0 +1,14 @@ +pub struct Def { + pub id: i32, +} + +impl Def { + pub fn new(id: i32) -> Def { + Def { id: id } + } +} + +#[no_mangle] +pub fn user() { + let _ = Def::new(0); +} |