blob: 030b95198f545b559e49849a210aef255a02d52f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
//@ only-elf
//@ needs-dynamic-linking
// FIXME(raw_dylib_elf): Debug the failures on other targets.
//@ only-gnu
//@ only-x86_64
//@ revisions: with without
//@ [without] build-fail
//@ [without] regex-error-pattern:error: linking with `.*` failed
//@ [without] dont-check-compiler-stderr
//@ [with] build-pass
//! Ensures that linking fails when there's an undefined symbol,
//! and that it does succeed with raw-dylib.
#![feature(raw_dylib_elf)]
#![allow(incomplete_features)]
#[cfg_attr(with, link(name = "rawdylibbutforcats", kind = "raw-dylib"))]
#[cfg_attr(without, link(name = "rawdylibbutforcats"))]
unsafe extern "C" {
safe fn meooooooooooooooow();
}
#[cfg_attr(with, link(name = "rawdylibbutfordogs", kind = "raw-dylib"))]
#[cfg_attr(without, link(name = "rawdylibbutfordogs"))]
unsafe extern "C" {
safe fn woooooooooooooooooof();
}
fn main() {
meooooooooooooooow();
woooooooooooooooooof();
}
//[without]~? ERROR linking with `
|