about summary refs log tree commit diff
path: root/src/test/ui/sepcomp
diff options
context:
space:
mode:
authorAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-05 09:13:28 +0100
committerAlbert Larsan <74931857+albertlarsan68@users.noreply.github.com>2023-01-11 09:32:08 +0000
commitcf2dff2b1e3fa55fa5415d524200070d0d7aacfe (patch)
tree40a88d9a46aaf3e8870676eb2538378b75a263eb /src/test/ui/sepcomp
parentca855e6e42787ecd062d81d53336fe6788ef51a9 (diff)
downloadrust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.tar.gz
rust-cf2dff2b1e3fa55fa5415d524200070d0d7aacfe.zip
Move /src/test to /tests
Diffstat (limited to 'src/test/ui/sepcomp')
-rw-r--r--src/test/ui/sepcomp/auxiliary/sepcomp-extern-lib.rs4
-rw-r--r--src/test/ui/sepcomp/auxiliary/sepcomp_cci_lib.rs6
-rw-r--r--src/test/ui/sepcomp/auxiliary/sepcomp_lib.rs21
-rw-r--r--src/test/ui/sepcomp/sepcomp-cci.rs33
-rw-r--r--src/test/ui/sepcomp/sepcomp-extern.rs33
-rw-r--r--src/test/ui/sepcomp/sepcomp-fns-backwards.rs33
-rw-r--r--src/test/ui/sepcomp/sepcomp-fns.rs30
-rw-r--r--src/test/ui/sepcomp/sepcomp-lib-lto.rs19
-rw-r--r--src/test/ui/sepcomp/sepcomp-lib.rs16
-rw-r--r--src/test/ui/sepcomp/sepcomp-statics.rs31
-rw-r--r--src/test/ui/sepcomp/sepcomp-unwind.rs35
11 files changed, 0 insertions, 261 deletions
diff --git a/src/test/ui/sepcomp/auxiliary/sepcomp-extern-lib.rs b/src/test/ui/sepcomp/auxiliary/sepcomp-extern-lib.rs
deleted file mode 100644
index 73fb5e8f3c4..00000000000
--- a/src/test/ui/sepcomp/auxiliary/sepcomp-extern-lib.rs
+++ /dev/null
@@ -1,4 +0,0 @@
-#[no_mangle]
-pub extern "C" fn foo() -> usize {
-    1234
-}
diff --git a/src/test/ui/sepcomp/auxiliary/sepcomp_cci_lib.rs b/src/test/ui/sepcomp/auxiliary/sepcomp_cci_lib.rs
deleted file mode 100644
index 64e34a56da4..00000000000
--- a/src/test/ui/sepcomp/auxiliary/sepcomp_cci_lib.rs
+++ /dev/null
@@ -1,6 +0,0 @@
-#[inline]
-pub fn cci_fn() -> usize {
-    1200
-}
-
-pub const CCI_CONST: usize = 34;
diff --git a/src/test/ui/sepcomp/auxiliary/sepcomp_lib.rs b/src/test/ui/sepcomp/auxiliary/sepcomp_lib.rs
deleted file mode 100644
index 1536228c265..00000000000
--- a/src/test/ui/sepcomp/auxiliary/sepcomp_lib.rs
+++ /dev/null
@@ -1,21 +0,0 @@
-// compile-flags: -C codegen-units=3 --crate-type=rlib,dylib -g
-
-pub mod a {
-    pub fn one() -> usize {
-        1
-    }
-}
-
-pub mod b {
-    pub fn two() -> usize {
-        2
-    }
-}
-
-pub mod c {
-    use a::one;
-    use b::two;
-    pub fn three() -> usize {
-        one() + two()
-    }
-}
diff --git a/src/test/ui/sepcomp/sepcomp-cci.rs b/src/test/ui/sepcomp/sepcomp-cci.rs
deleted file mode 100644
index 02bbab30e9c..00000000000
--- a/src/test/ui/sepcomp/sepcomp-cci.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// run-pass
-// compile-flags: -C codegen-units=3
-// aux-build:sepcomp_cci_lib.rs
-
-// Test accessing cross-crate inlined items from multiple compilation units.
-
-
-extern crate sepcomp_cci_lib;
-use sepcomp_cci_lib::{cci_fn, CCI_CONST};
-
-fn call1() -> usize {
-    cci_fn() + CCI_CONST
-}
-
-mod a {
-    use sepcomp_cci_lib::{cci_fn, CCI_CONST};
-    pub fn call2() -> usize {
-        cci_fn() + CCI_CONST
-    }
-}
-
-mod b {
-    use sepcomp_cci_lib::{cci_fn, CCI_CONST};
-    pub fn call3() -> usize {
-        cci_fn() + CCI_CONST
-    }
-}
-
-fn main() {
-    assert_eq!(call1(), 1234);
-    assert_eq!(a::call2(), 1234);
-    assert_eq!(b::call3(), 1234);
-}
diff --git a/src/test/ui/sepcomp/sepcomp-extern.rs b/src/test/ui/sepcomp/sepcomp-extern.rs
deleted file mode 100644
index 6323bf664fc..00000000000
--- a/src/test/ui/sepcomp/sepcomp-extern.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// run-pass
-// compile-flags: -C codegen-units=3
-// aux-build:sepcomp-extern-lib.rs
-
-// Test accessing external items from multiple compilation units.
-
-extern crate sepcomp_extern_lib;
-
-extern "C" {
-    fn foo() -> usize;
-}
-
-fn call1() -> usize {
-    unsafe { foo() }
-}
-
-mod a {
-    pub fn call2() -> usize {
-        unsafe { ::foo() }
-    }
-}
-
-mod b {
-    pub fn call3() -> usize {
-        unsafe { ::foo() }
-    }
-}
-
-fn main() {
-    assert_eq!(call1(), 1234);
-    assert_eq!(a::call2(), 1234);
-    assert_eq!(b::call3(), 1234);
-}
diff --git a/src/test/ui/sepcomp/sepcomp-fns-backwards.rs b/src/test/ui/sepcomp/sepcomp-fns-backwards.rs
deleted file mode 100644
index f56769e2b8c..00000000000
--- a/src/test/ui/sepcomp/sepcomp-fns-backwards.rs
+++ /dev/null
@@ -1,33 +0,0 @@
-// run-pass
-#![allow(dead_code)]
-// compile-flags: -C codegen-units=3
-
-// Test references to items that haven't been codegened yet.
-
-// Generate some code in the first compilation unit before declaring any
-// modules.  This ensures that the first module doesn't go into the same
-// compilation unit as the top-level module.
-
-fn pad() -> usize { 0 }
-
-mod b {
-    pub fn three() -> usize {
-        ::one() + ::a::two()
-    }
-}
-
-mod a {
-    pub fn two() -> usize {
-        ::one() + ::one()
-    }
-}
-
-fn one() -> usize {
-    1
-}
-
-fn main() {
-    assert_eq!(one(), 1);
-    assert_eq!(a::two(), 2);
-    assert_eq!(b::three(), 3);
-}
diff --git a/src/test/ui/sepcomp/sepcomp-fns.rs b/src/test/ui/sepcomp/sepcomp-fns.rs
deleted file mode 100644
index a432c89606e..00000000000
--- a/src/test/ui/sepcomp/sepcomp-fns.rs
+++ /dev/null
@@ -1,30 +0,0 @@
-// run-pass
-// compile-flags: -C codegen-units=3
-
-// Test basic separate compilation functionality.  The functions should be able
-// to call each other even though they will be placed in different compilation
-// units.
-
-// Generate some code in the first compilation unit before declaring any
-// modules.  This ensures that the first module doesn't go into the same
-// compilation unit as the top-level module.
-
-fn one() -> usize { 1 }
-
-mod a {
-    pub fn two() -> usize {
-        ::one() + ::one()
-    }
-}
-
-mod b {
-    pub fn three() -> usize {
-        ::one() + ::a::two()
-    }
-}
-
-fn main() {
-    assert_eq!(one(), 1);
-    assert_eq!(a::two(), 2);
-    assert_eq!(b::three(), 3);
-}
diff --git a/src/test/ui/sepcomp/sepcomp-lib-lto.rs b/src/test/ui/sepcomp/sepcomp-lib-lto.rs
deleted file mode 100644
index 51a572899f8..00000000000
--- a/src/test/ui/sepcomp/sepcomp-lib-lto.rs
+++ /dev/null
@@ -1,19 +0,0 @@
-// run-pass
-// Check that we can use `-C lto` when linking against libraries that were
-// separately compiled.
-
-// aux-build:sepcomp_lib.rs
-// compile-flags: -C lto -g
-// ignore-asmjs wasm2js does not support source maps yet
-// no-prefer-dynamic
-
-extern crate sepcomp_lib;
-use sepcomp_lib::a::one;
-use sepcomp_lib::b::two;
-use sepcomp_lib::c::three;
-
-fn main() {
-    assert_eq!(one(), 1);
-    assert_eq!(two(), 2);
-    assert_eq!(three(), 3);
-}
diff --git a/src/test/ui/sepcomp/sepcomp-lib.rs b/src/test/ui/sepcomp/sepcomp-lib.rs
deleted file mode 100644
index 728dc078b7e..00000000000
--- a/src/test/ui/sepcomp/sepcomp-lib.rs
+++ /dev/null
@@ -1,16 +0,0 @@
-// run-pass
-// aux-build:sepcomp_lib.rs
-
-// Test linking against a library built with -C codegen-units > 1
-
-
-extern crate sepcomp_lib;
-use sepcomp_lib::a::one;
-use sepcomp_lib::b::two;
-use sepcomp_lib::c::three;
-
-fn main() {
-    assert_eq!(one(), 1);
-    assert_eq!(two(), 2);
-    assert_eq!(three(), 3);
-}
diff --git a/src/test/ui/sepcomp/sepcomp-statics.rs b/src/test/ui/sepcomp/sepcomp-statics.rs
deleted file mode 100644
index 5457c8a0ae9..00000000000
--- a/src/test/ui/sepcomp/sepcomp-statics.rs
+++ /dev/null
@@ -1,31 +0,0 @@
-// run-pass
-#![allow(dead_code)]
-// compile-flags: -C codegen-units=3
-
-// Test references to static items across compilation units.
-
-
-fn pad() -> usize { 0 }
-
-const ONE: usize = 1;
-
-mod b {
-    // Separate compilation always switches to the LLVM module with the fewest
-    // instructions.  Make sure we have some instructions in this module so
-    // that `a` and `b` don't go into the same compilation unit.
-    fn pad() -> usize { 0 }
-
-    pub static THREE: usize = ::ONE + ::a::TWO;
-}
-
-mod a {
-    fn pad() -> usize { 0 }
-
-    pub const TWO: usize = ::ONE + ::ONE;
-}
-
-fn main() {
-    assert_eq!(ONE, 1);
-    assert_eq!(a::TWO, 2);
-    assert_eq!(b::THREE, 3);
-}
diff --git a/src/test/ui/sepcomp/sepcomp-unwind.rs b/src/test/ui/sepcomp/sepcomp-unwind.rs
deleted file mode 100644
index a59e25a273e..00000000000
--- a/src/test/ui/sepcomp/sepcomp-unwind.rs
+++ /dev/null
@@ -1,35 +0,0 @@
-// run-pass
-// needs-unwind
-#![allow(dead_code)]
-// compile-flags: -C codegen-units=3
-// ignore-emscripten no threads support
-
-// Test unwinding through multiple compilation units.
-
-// According to acrichto, in the distant past `ld -r` (which is used during
-// linking when codegen-units > 1) was known to produce object files with
-// damaged unwinding tables.  This may be related to GNU binutils bug #6893
-// ("Partial linking results in corrupt .eh_frame_hdr"), but I'm not certain.
-// In any case, this test should let us know if enabling parallel codegen ever
-// breaks unwinding.
-
-
-use std::thread;
-
-fn pad() -> usize { 0 }
-
-mod a {
-    pub fn f() {
-        panic!();
-    }
-}
-
-mod b {
-    pub fn g() {
-        ::a::f();
-    }
-}
-
-fn main() {
-    thread::spawn(move|| { ::b::g() }).join().unwrap_err();
-}