diff options
Diffstat (limited to 'tests/run-make/pass-linker-flags-flavor')
-rw-r--r-- | tests/run-make/pass-linker-flags-flavor/Makefile | 11 | ||||
-rw-r--r-- | tests/run-make/pass-linker-flags-flavor/attribute.rs | 12 | ||||
-rw-r--r-- | tests/run-make/pass-linker-flags-flavor/empty.rs | 1 |
3 files changed, 24 insertions, 0 deletions
diff --git a/tests/run-make/pass-linker-flags-flavor/Makefile b/tests/run-make/pass-linker-flags-flavor/Makefile new file mode 100644 index 000000000..1bb05d0f9 --- /dev/null +++ b/tests/run-make/pass-linker-flags-flavor/Makefile @@ -0,0 +1,11 @@ +# only-linux + +include ../tools.mk + +all: + $(RUSTC) empty.rs -Z unstable-options -C linker-flavor=gnu-cc -l static=l1 -l link-arg=a1 -l static=l2 -l link-arg=a2 -l dylib=d1 -l link-arg=a3 --print link-args | $(CGREP) -e 'l1.*-Wl,a1.*l2.*-Wl,a2.*d1.*-Wl,a3' + $(RUSTC) empty.rs -Z unstable-options -C linker-flavor=gnu-cc -l static=l1 -l link-arg:+verbatim=a1 -l static=l2 -l link-arg=a2 -l dylib=d1 -l link-arg=a3 --print link-args | $(CGREP) -e 'l1.*"a1".*l2.*-Wl,a2.*d1.*-Wl,a3' + $(RUSTC) empty.rs -Z unstable-options -C linker-flavor=ld -l static=l1 -l link-arg=a1 -l static=l2 -l link-arg=a2 -l dylib=d1 -l link-arg=a3 --print link-args | $(CGREP) -e 'l1.*"a1".*l2.*"a2".*d1.*"a3"' + $(RUSTC) attribute.rs -Z unstable-options -C linker-flavor=gnu-cc --print link-args | $(CGREP) -e 'l1.*-Wl,a1.*l2.*-Wl,a2.*d1.*-Wl,a3' + $(RUSTC) --cfg 'feature="verbatim"' attribute.rs -Z unstable-options -C linker-flavor=gnu-cc --print link-args | $(CGREP) -e 'l1.*"a1".*l2.*-Wl,a2.*d1.*-Wl,a3' + $(RUSTC) attribute.rs -C linker-flavor=ld --print link-args | $(CGREP) -e 'l1.*"a1".*l2.*"a2".*d1.*"a3"' diff --git a/tests/run-make/pass-linker-flags-flavor/attribute.rs b/tests/run-make/pass-linker-flags-flavor/attribute.rs new file mode 100644 index 000000000..d09916530 --- /dev/null +++ b/tests/run-make/pass-linker-flags-flavor/attribute.rs @@ -0,0 +1,12 @@ +#![feature(link_arg_attribute)] + +#[link(kind = "static", name = "l1")] +#[cfg_attr(feature = "verbatim", link(kind = "link-arg", name = "a1", modifiers = "+verbatim"))] +#[cfg_attr(not(feature = "verbatim"), link(kind = "link-arg", name = "a1"))] +#[link(kind = "static", name = "l2")] +#[link(kind = "link-arg", name = "a2")] +#[link(kind = "dylib", name = "d1")] +#[link(kind = "link-arg", name = "a3")] +extern "C" {} + +fn main() {} diff --git a/tests/run-make/pass-linker-flags-flavor/empty.rs b/tests/run-make/pass-linker-flags-flavor/empty.rs new file mode 100644 index 000000000..f328e4d9d --- /dev/null +++ b/tests/run-make/pass-linker-flags-flavor/empty.rs @@ -0,0 +1 @@ +fn main() {} |