From 5f38367da385b9e602a2d42833912ec927890a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20F=C3=A4rnstrand?= Date: Fri, 20 Jul 2018 11:15:25 +0200 Subject: [PATCH] Add testing with align feature --- ci/run.sh | 6 +++++- libc-test/Cargo.toml | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ci/run.sh b/ci/run.sh index ffcd0421..27ffc054 100755 --- a/ci/run.sh +++ b/ci/run.sh @@ -79,7 +79,7 @@ if [ "$QEMU" != "" ]; then exec grep "^PASSED .* tests" $CARGO_TARGET_DIR/out.log fi -# FIXME: x86_64-unknown-linux-gnux32 fail to compile wihout --release +# FIXME: x86_64-unknown-linux-gnux32 fail to compile without --release # See https://github.com/rust-lang/rust/issues/45417 opt= if [ "$TARGET" = "x86_64-unknown-linux-gnux32" ]; then @@ -91,4 +91,8 @@ fi if [ "$TARGET" != "x86_64-rumprun-netbsd" ]; then cargo test $opt --no-default-features --manifest-path libc-test/Cargo.toml --target $TARGET fi +# Test the #[repr(align(x))] feature if this is building on Rust >= 1.25 +if [ $(rustc --version | sed -E 's/^rustc 1\.([0-9]*)\..*/\1/') -ge 25 ]; then + cargo test $opt --features align --manifest-path libc-test/Cargo.toml --target $TARGET +fi exec cargo test $opt --manifest-path libc-test/Cargo.toml --target $TARGET diff --git a/libc-test/Cargo.toml b/libc-test/Cargo.toml index 8d0f9d34..c6950d6e 100644 --- a/libc-test/Cargo.toml +++ b/libc-test/Cargo.toml @@ -14,6 +14,7 @@ ctest = { git = "https://github.com/alexcrichton/ctest" } [features] default = [ "use_std" ] use_std = [ "libc/use_std" ] +align = [ "libc/align" ] [[test]] name = "main"