diff options
Diffstat (limited to 'tests/run-make-fulldeps/extern-fn-with-union')
4 files changed, 0 insertions, 46 deletions
diff --git a/tests/run-make-fulldeps/extern-fn-with-union/Makefile b/tests/run-make-fulldeps/extern-fn-with-union/Makefile deleted file mode 100644 index 40bae923e..000000000 --- a/tests/run-make-fulldeps/extern-fn-with-union/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -include ../tools.mk - -all: $(call NATIVE_STATICLIB,ctest) - $(RUSTC) testcrate.rs - $(RUSTC) test.rs - $(call RUN,test) || exit 1 diff --git a/tests/run-make-fulldeps/extern-fn-with-union/ctest.c b/tests/run-make-fulldeps/extern-fn-with-union/ctest.c deleted file mode 100644 index 86cb64537..000000000 --- a/tests/run-make-fulldeps/extern-fn-with-union/ctest.c +++ /dev/null @@ -1,10 +0,0 @@ -#include <stdio.h> -#include <stdint.h> - -typedef union TestUnion { - uint64_t bits; -} TestUnion; - -uint64_t give_back(TestUnion tu) { - return tu.bits; -} diff --git a/tests/run-make-fulldeps/extern-fn-with-union/test.rs b/tests/run-make-fulldeps/extern-fn-with-union/test.rs deleted file mode 100644 index 438fbddf3..000000000 --- a/tests/run-make-fulldeps/extern-fn-with-union/test.rs +++ /dev/null @@ -1,19 +0,0 @@ -extern crate testcrate; - -use std::mem; - -extern "C" { - fn give_back(tu: testcrate::TestUnion) -> u64; -} - -fn main() { - let magic: u64 = 0xDEADBEEF; - - // Let's test calling it cross crate - let back = unsafe { testcrate::give_back(mem::transmute(magic)) }; - assert_eq!(magic, back); - - // And just within this crate - let back = unsafe { give_back(mem::transmute(magic)) }; - assert_eq!(magic, back); -} diff --git a/tests/run-make-fulldeps/extern-fn-with-union/testcrate.rs b/tests/run-make-fulldeps/extern-fn-with-union/testcrate.rs deleted file mode 100644 index 28d91ff37..000000000 --- a/tests/run-make-fulldeps/extern-fn-with-union/testcrate.rs +++ /dev/null @@ -1,11 +0,0 @@ -#![crate_type = "lib"] - -#[repr(C)] -pub struct TestUnion { - _val: u64, -} - -#[link(name = "ctest", kind = "static")] -extern "C" { - pub fn give_back(tu: TestUnion) -> u64; -} |