Skip to content

Commit aab5034

Browse files
committed
Test with the 'c' feature enabled on CI
1 parent d63757c commit aab5034

File tree

4 files changed

+15
-20
lines changed

4 files changed

+15
-20
lines changed

Cargo.toml

+4
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,9 @@ utest-cortex-m-qemu = { default-features = false, git = "https://github.com/japa
2727
utest-macros = { git = "https://github.com/japaric/utest" }
2828

2929

30+
[[example]]
31+
name = "intrinsics"
32+
required-features = ["c"]
33+
3034

3135
[workspace]

appveyor.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ environment:
55

66
install:
77
- git submodule update --init
8-
- curl -sSf -o rustup-init.exe https://win.rustup.rs
8+
- appveyor-retry appveyor DownloadFile https://win.rustup.rs/ -FileName rustup-init.exe
99
- rustup-init.exe --default-host x86_64-pc-windows-msvc --default-toolchain nightly -y
1010
- set PATH=%PATH%;C:\Users\appveyor\.cargo\bin
1111
- if "%TARGET%"=="i686-pc-windows-msvc" ( rustup target add %TARGET% )
@@ -18,4 +18,6 @@ test_script:
1818
- cargo build --target %TARGET%
1919
- cargo build --release --target %TARGET%
2020
- cargo test --no-default-features --features gen-tests --target %TARGET%
21+
- cargo test --no-default-features --features 'gen-tests c' --target %TARGET%
2122
- cargo test --no-default-features --features gen-tests --release --target %TARGET%
23+
- cargo test --no-default-features --features 'gen-tests c' --release --target %TARGET%

ci/run.sh

+2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ case $1 in
3434
;;
3535
*)
3636
cargo test --no-default-features --features gen-tests --target $1
37+
cargo test --no-default-features --features 'gen-tests c' --target $1
3738
cargo test --no-default-features --features gen-tests --target $1 --release
39+
cargo test --no-default-features --features 'gen-tests c' --target $1 --release
3840
;;
3941
esac
4042

examples/intrinsics.rs

+6-19
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
#![allow(unused_features)]
77
#![cfg_attr(thumb, no_main)]
88
#![deny(dead_code)]
9+
#![feature(alloc_system)]
910
#![feature(asm)]
1011
#![feature(compiler_builtins_lib)]
1112
#![feature(core_float)]
1213
#![feature(lang_items)]
13-
#![feature(libc)]
1414
#![feature(start)]
1515
#![feature(i128_type)]
1616
#![no_std]
1717

1818
#[cfg(not(thumb))]
19-
extern crate libc;
19+
extern crate alloc_system;
2020
extern crate compiler_builtins;
2121

2222
// NOTE cfg(not(thumbv6m)) means that the operation is not supported on ARMv6-M at all. Not even
@@ -27,7 +27,6 @@ extern crate compiler_builtins;
2727
// convention for its intrinsics that's different from other architectures; that's why some function
2828
// have an additional comment: the function name is the ARM name for the intrinsic and the comment
2929
// in the non-ARM name for the intrinsic.
30-
#[cfg(feature = "c")]
3130
mod intrinsics {
3231
use core::num::Float;
3332

@@ -339,7 +338,6 @@ mod intrinsics {
339338
}
340339
}
341340

342-
#[cfg(feature = "c")]
343341
fn run() {
344342
use intrinsics::*;
345343

@@ -404,33 +402,20 @@ fn run() {
404402
bb(modti3(bb(2), bb(2)));
405403
}
406404

407-
#[cfg(all(feature = "c", not(thumb)))]
405+
#[cfg(not(thumb))]
408406
#[start]
409407
fn main(_: isize, _: *const *const u8) -> isize {
410408
run();
411-
412-
0
413-
}
414-
415-
#[cfg(all(not(feature = "c"), not(thumb)))]
416-
#[start]
417-
fn main(_: isize, _: *const *const u8) -> isize {
418409
0
419410
}
420411

421-
#[cfg(all(feature = "c", thumb))]
412+
#[cfg(thumb)]
422413
#[no_mangle]
423414
pub fn _start() -> ! {
424415
run();
425416
loop {}
426417
}
427418

428-
#[cfg(all(not(feature = "c"), thumb))]
429-
#[no_mangle]
430-
pub fn _start() -> ! {
431-
loop {}
432-
}
433-
434419
// ARM targets need these symbols
435420
#[no_mangle]
436421
pub fn __aeabi_unwind_cpp_pr0() {}
@@ -447,9 +432,11 @@ pub fn _Unwind_Resume() {}
447432
#[cfg(not(test))]
448433
#[lang = "eh_personality"]
449434
#[no_mangle]
435+
#[allow(private_no_mangle_fns)]
450436
extern "C" fn eh_personality() {}
451437

452438
#[cfg(not(test))]
453439
#[lang = "panic_fmt"]
454440
#[no_mangle]
441+
#[allow(private_no_mangle_fns)]
455442
extern "C" fn panic_fmt() {}

0 commit comments

Comments
 (0)