diff options
author | Daniel Mueller <deso@posteo.net> | 2017-03-26 17:07:27 -0700 |
---|---|---|
committer | Daniel Mueller <deso@posteo.net> | 2017-03-26 17:07:27 -0700 |
commit | 86415f23a86b5a44aa000d513500a9d1d0df4bba (patch) | |
tree | 5a9c513c9531414502de67dda322fca9baac7563 /gcc/gcc-test/tests/all.rs | |
parent | 547085cdefb3372e8c42beabac5d45f2f6b1a535 (diff) | |
download | nitrocli-86415f23a86b5a44aa000d513500a9d1d0df4bba.tar.gz nitrocli-86415f23a86b5a44aa000d513500a9d1d0df4bba.tar.bz2 |
Import subrepo gcc/:gcc at cf1f00bc038a0df769e14bb85480ab9c12eae08d
Diffstat (limited to 'gcc/gcc-test/tests/all.rs')
-rw-r--r-- | gcc/gcc-test/tests/all.rs | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/gcc/gcc-test/tests/all.rs b/gcc/gcc-test/tests/all.rs new file mode 100644 index 0000000..7b70f4e --- /dev/null +++ b/gcc/gcc-test/tests/all.rs @@ -0,0 +1,60 @@ +extern crate gcc_test; + +use gcc_test::*; + +#[link(name = "OptLinkage", kind = "static")] +extern "C" { + fn answer() -> i32; +} + +#[test] +fn foo_here() { + unsafe { + assert_eq!(foo(), 4); + } +} + +#[test] +fn bar_here() { + unsafe { + assert_eq!(bar1(), 5); + assert_eq!(bar2(), 6); + } +} + +#[test] +fn asm_here() { + unsafe { + assert_eq!(asm(), 7); + } +} + +#[test] +fn baz_here() { + unsafe { + assert_eq!(baz(), 8); + } +} + +#[test] +#[cfg(windows)] +fn windows_here() { + unsafe { + windows(); + } +} + +#[test] +#[cfg(target_env = "msvc")] +fn msvc_here() { + unsafe { + msvc(); + } +} + +#[test] +fn opt_linkage() { + unsafe { + assert_eq!(answer(), 42); + } +} |