From 9be35f82c1abf2ecbab489bca9eca138ea648312 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 27 Jul 2019 01:33:01 +0300 Subject: tests: Move run-pass tests without naming conflicts to ui --- src/test/ui/thinlto/weak-works.rs | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/ui/thinlto/weak-works.rs (limited to 'src/test/ui/thinlto/weak-works.rs') diff --git a/src/test/ui/thinlto/weak-works.rs b/src/test/ui/thinlto/weak-works.rs new file mode 100644 index 00000000000..163a3870248 --- /dev/null +++ b/src/test/ui/thinlto/weak-works.rs @@ -0,0 +1,28 @@ +// run-pass + +// compile-flags: -C codegen-units=8 -Z thinlto +// ignore-windows + +#![feature(linkage)] + +pub mod foo { + #[linkage = "weak"] + #[no_mangle] + pub extern "C" fn FOO() -> i32 { + 0 + } +} + +mod bar { + extern "C" { + fn FOO() -> i32; + } + + pub fn bar() -> i32 { + unsafe { FOO() } + } +} + +fn main() { + bar::bar(); +} -- cgit 1.4.1-3-g733a5