diff options
| author | bors <bors@rust-lang.org> | 2018-12-14 16:15:20 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-12-14 16:15:20 +0000 |
| commit | 1897657ef09eea3d0b0afbbbd154a12fbb8fbf3f (patch) | |
| tree | 617ccab3713b1745724294eca3a33ad0642b6244 /src/test | |
| parent | 7d03617bab24a689bc704e71e509b9c11c655f26 (diff) | |
| parent | e065de2ea88430c55b824f5f280c965e1230762b (diff) | |
| download | rust-1897657ef09eea3d0b0afbbbd154a12fbb8fbf3f.tar.gz rust-1897657ef09eea3d0b0afbbbd154a12fbb8fbf3f.zip | |
Auto merge of #56818 - kennytm:rollup-2, r=kennytm
Rollup of 14 pull requests (first batch) Successful merges: - #56562 (Update libc version required by rustc) - #56609 (Unconditionally emit the target-cpu LLVM attribute.) - #56637 (rustdoc: Fix local reexports of proc macros) - #56658 (Add non-panicking `maybe_new_parser_from_file` variant) - #56695 (Fix irrefutable matches on integer ranges) - #56699 (Use a `newtype_index!` within `Symbol`.) - #56702 ([self-profiler] Add column for percent of total time) - #56708 (Remove some unnecessary feature gates) - #56709 (Remove unneeded extra chars to reduce search-index size) - #56744 (specialize: remove Boxes used by Children::insert) - #56748 (Update panic message to be clearer about env-vars) - #56749 (x86: Add the `adx` target feature to whitelist) - #56756 (Disable btree pretty-printers on older gdbs) - #56789 (rustc: Add an unstable `simd_select_bitmask` intrinsic) r? @ghost
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/codegen/simd-intrinsic-generic-select.rs | 12 | ||||
| -rw-r--r-- | src/test/debuginfo/pretty-std-collections.rs | 6 | ||||
| -rw-r--r-- | src/test/run-make-fulldeps/libtest-json/output.json | 2 | ||||
| -rw-r--r-- | src/test/run-pass/multi-panic.rs | 3 | ||||
| -rw-r--r-- | src/test/run-pass/simd/simd-intrinsic-generic-select.rs | 30 | ||||
| -rw-r--r-- | src/test/rustdoc-ui/failed-doctest-output.stdout | 4 | ||||
| -rw-r--r-- | src/test/rustdoc/proc-macro.rs | 13 | ||||
| -rw-r--r-- | src/test/ui/pattern/irrefutable-exhaustive-integer-binding.rs | 8 | ||||
| -rw-r--r-- | src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs | 10 | ||||
| -rw-r--r-- | src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr | 26 |
10 files changed, 105 insertions, 9 deletions
diff --git a/src/test/codegen/simd-intrinsic-generic-select.rs b/src/test/codegen/simd-intrinsic-generic-select.rs index 8a64d7437d8..24a4b2b1b05 100644 --- a/src/test/codegen/simd-intrinsic-generic-select.rs +++ b/src/test/codegen/simd-intrinsic-generic-select.rs @@ -21,10 +21,15 @@ pub struct f32x4(pub f32, pub f32, pub f32, pub f32); #[repr(simd)] #[derive(Copy, Clone, PartialEq, Debug)] +pub struct f32x8(f32, f32, f32, f32, f32, f32, f32, f32); + +#[repr(simd)] +#[derive(Copy, Clone, PartialEq, Debug)] pub struct b8x4(pub i8, pub i8, pub i8, pub i8); extern "platform-intrinsic" { fn simd_select<T, U>(x: T, a: U, b: U) -> U; + fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U; } // CHECK-LABEL: @select @@ -33,3 +38,10 @@ pub unsafe fn select(m: b8x4, a: f32x4, b: f32x4) -> f32x4 { // CHECK: select <4 x i1> simd_select(m, a, b) } + +// CHECK-LABEL: @select_bitmask +#[no_mangle] +pub unsafe fn select_bitmask(m: i8, a: f32x8, b: f32x8) -> f32x8 { + // CHECK: select <8 x i1> + simd_select_bitmask(m, a, b) +} diff --git a/src/test/debuginfo/pretty-std-collections.rs b/src/test/debuginfo/pretty-std-collections.rs index a51be370aa4..350b30d2cc1 100644 --- a/src/test/debuginfo/pretty-std-collections.rs +++ b/src/test/debuginfo/pretty-std-collections.rs @@ -13,7 +13,11 @@ // ignore-freebsd: gdb package too new // ignore-android: FIXME(#10381) // compile-flags:-g -// min-gdb-version 7.7 + +// The pretty printers being tested here require the patch from +// https://sourceware.org/bugzilla/show_bug.cgi?id=21763 +// min-gdb-version 8.1 + // min-lldb-version: 310 // === GDB TESTS =================================================================================== diff --git a/src/test/run-make-fulldeps/libtest-json/output.json b/src/test/run-make-fulldeps/libtest-json/output.json index 80e75c89bfc..2b831ea2bdc 100644 --- a/src/test/run-make-fulldeps/libtest-json/output.json +++ b/src/test/run-make-fulldeps/libtest-json/output.json @@ -2,7 +2,7 @@ { "type": "test", "event": "started", "name": "a" } { "type": "test", "name": "a", "event": "ok" } { "type": "test", "event": "started", "name": "b" } -{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:18:5\nnote: Run with `RUST_BACKTRACE=1` for a backtrace.\n" } +{ "type": "test", "name": "b", "event": "failed", "stdout": "thread 'main' panicked at 'assertion failed: false', f.rs:18:5\nnote: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace.\n" } { "type": "test", "event": "started", "name": "c" } { "type": "test", "name": "c", "event": "ok" } { "type": "test", "event": "started", "name": "d" } diff --git a/src/test/run-pass/multi-panic.rs b/src/test/run-pass/multi-panic.rs index 2e6e10935fa..03e58fc2387 100644 --- a/src/test/run-pass/multi-panic.rs +++ b/src/test/run-pass/multi-panic.rs @@ -17,7 +17,8 @@ fn check_for_no_backtrace(test: std::process::Output) { let mut it = err.lines(); assert_eq!(it.next().map(|l| l.starts_with("thread '<unnamed>' panicked at")), Some(true)); - assert_eq!(it.next(), Some("note: Run with `RUST_BACKTRACE=1` for a backtrace.")); + assert_eq!(it.next(), Some("note: Run with `RUST_BACKTRACE=1` \ + environment variable to display a backtrace.")); assert_eq!(it.next().map(|l| l.starts_with("thread 'main' panicked at")), Some(true)); assert_eq!(it.next(), None); } diff --git a/src/test/run-pass/simd/simd-intrinsic-generic-select.rs b/src/test/run-pass/simd/simd-intrinsic-generic-select.rs index 590a2990270..74b99ca4950 100644 --- a/src/test/run-pass/simd/simd-intrinsic-generic-select.rs +++ b/src/test/run-pass/simd/simd-intrinsic-generic-select.rs @@ -28,6 +28,10 @@ struct u32x4(pub u32, pub u32, pub u32, pub u32); #[repr(simd)] #[derive(Copy, Clone, PartialEq, Debug)] +struct u32x8(u32, u32, u32, u32, u32, u32, u32, u32); + +#[repr(simd)] +#[derive(Copy, Clone, PartialEq, Debug)] struct f32x4(pub f32, pub f32, pub f32, pub f32); #[repr(simd)] @@ -36,6 +40,7 @@ struct b8x4(pub i8, pub i8, pub i8, pub i8); extern "platform-intrinsic" { fn simd_select<T, U>(x: T, a: U, b: U) -> U; + fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U; } fn main() { @@ -146,4 +151,29 @@ fn main() { let e = b8x4(t, f, t, t); assert_eq!(r, e); } + + unsafe { + let a = u32x8(0, 1, 2, 3, 4, 5, 6, 7); + let b = u32x8(8, 9, 10, 11, 12, 13, 14, 15); + + let r: u32x8 = simd_select_bitmask(0u8, a, b); + let e = b; + assert_eq!(r, e); + + let r: u32x8 = simd_select_bitmask(0xffu8, a, b); + let e = a; + assert_eq!(r, e); + + let r: u32x8 = simd_select_bitmask(0b01010101u8, a, b); + let e = u32x8(0, 9, 2, 11, 4, 13, 6, 15); + assert_eq!(r, e); + + let r: u32x8 = simd_select_bitmask(0b10101010u8, a, b); + let e = u32x8(8, 1, 10, 3, 12, 5, 14, 7); + assert_eq!(r, e); + + let r: u32x8 = simd_select_bitmask(0b11110000u8, a, b); + let e = u32x8(8, 9, 10, 11, 4, 5, 6, 7); + assert_eq!(r, e); + } } diff --git a/src/test/rustdoc-ui/failed-doctest-output.stdout b/src/test/rustdoc-ui/failed-doctest-output.stdout index cd19099647c..bd6fa1f84b4 100644 --- a/src/test/rustdoc-ui/failed-doctest-output.stdout +++ b/src/test/rustdoc-ui/failed-doctest-output.stdout @@ -13,13 +13,13 @@ error[E0425]: cannot find value `no` in this scope | ^^ not found in this scope thread '$DIR/failed-doctest-output.rs - OtherStruct (line 27)' panicked at 'couldn't compile the test', src/librustdoc/test.rs:326:13 -note: Run with `RUST_BACKTRACE=1` for a backtrace. +note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. ---- $DIR/failed-doctest-output.rs - SomeStruct (line 21) stdout ---- thread '$DIR/failed-doctest-output.rs - SomeStruct (line 21)' panicked at 'test executable failed: thread 'main' panicked at 'oh no', $DIR/failed-doctest-output.rs:3:1 -note: Run with `RUST_BACKTRACE=1` for a backtrace. +note: Run with `RUST_BACKTRACE=1` environment variable to display a backtrace. ', src/librustdoc/test.rs:361:17 diff --git a/src/test/rustdoc/proc-macro.rs b/src/test/rustdoc/proc-macro.rs index 23d0d005807..05d64f82fbd 100644 --- a/src/test/rustdoc/proc-macro.rs +++ b/src/test/rustdoc/proc-macro.rs @@ -61,3 +61,16 @@ pub fn some_proc_attr(_attr: TokenStream, item: TokenStream) -> TokenStream { pub fn some_derive(_item: TokenStream) -> TokenStream { TokenStream::new() } + +// @has some_macros/foo/index.html +pub mod foo { + // @has - '//code' 'pub use some_proc_macro;' + // @has - '//a/@href' '../../some_macros/macro.some_proc_macro.html' + pub use some_proc_macro; + // @has - '//code' 'pub use some_proc_attr;' + // @has - '//a/@href' '../../some_macros/attr.some_proc_attr.html' + pub use some_proc_attr; + // @has - '//code' 'pub use some_derive;' + // @has - '//a/@href' '../../some_macros/derive.SomeDerive.html' + pub use some_derive; +} diff --git a/src/test/ui/pattern/irrefutable-exhaustive-integer-binding.rs b/src/test/ui/pattern/irrefutable-exhaustive-integer-binding.rs new file mode 100644 index 00000000000..ff065882d96 --- /dev/null +++ b/src/test/ui/pattern/irrefutable-exhaustive-integer-binding.rs @@ -0,0 +1,8 @@ +// run-pass + +fn main() { + let -2147483648..=2147483647 = 1; + let 0..=255 = 0u8; + let -128..=127 = 0i8; + let '\u{0000}'..='\u{10FFFF}' = 'v'; +} diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs index d74d6815d5f..2a2d35e7bd9 100644 --- a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs +++ b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.rs @@ -33,6 +33,7 @@ struct b8x8(pub i8, pub i8, pub i8, pub i8, extern "platform-intrinsic" { fn simd_select<T, U>(x: T, a: U, b: U) -> U; + fn simd_select_bitmask<T, U>(x: T, a: U, b: U) -> U; } fn main() { @@ -52,5 +53,14 @@ fn main() { simd_select(z, z, z); //~^ ERROR mask element type is `f32`, expected `i_` + + simd_select_bitmask(0u8, x, x); + //~^ ERROR mask length `8` != other vector length `4` + + simd_select_bitmask(0.0f32, x, x); + //~^ ERROR `f32` is not an integral type + + simd_select_bitmask("x", x, x); + //~^ ERROR `&str` is not an integral type } } diff --git a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr index 61e42027039..584f3d53921 100644 --- a/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr +++ b/src/test/ui/simd-intrinsic/simd-intrinsic-generic-select.stderr @@ -1,21 +1,39 @@ error[E0511]: invalid monomorphization of `simd_select` intrinsic: mismatched lengths: mask length `8` != other vector length `4` - --> $DIR/simd-intrinsic-generic-select.rs:47:9 + --> $DIR/simd-intrinsic-generic-select.rs:48:9 | LL | simd_select(m8, x, x); | ^^^^^^^^^^^^^^^^^^^^^ error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `u32`, expected `i_` - --> $DIR/simd-intrinsic-generic-select.rs:50:9 + --> $DIR/simd-intrinsic-generic-select.rs:51:9 | LL | simd_select(x, x, x); | ^^^^^^^^^^^^^^^^^^^^ error[E0511]: invalid monomorphization of `simd_select` intrinsic: mask element type is `f32`, expected `i_` - --> $DIR/simd-intrinsic-generic-select.rs:53:9 + --> $DIR/simd-intrinsic-generic-select.rs:54:9 | LL | simd_select(z, z, z); | ^^^^^^^^^^^^^^^^^^^^ -error: aborting due to 3 previous errors +error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: mismatched lengths: mask length `8` != other vector length `4` + --> $DIR/simd-intrinsic-generic-select.rs:57:9 + | +LL | simd_select_bitmask(0u8, x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: `f32` is not an integral type + --> $DIR/simd-intrinsic-generic-select.rs:60:9 + | +LL | simd_select_bitmask(0.0f32, x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error[E0511]: invalid monomorphization of `simd_select_bitmask` intrinsic: `&str` is not an integral type + --> $DIR/simd-intrinsic-generic-select.rs:63:9 + | +LL | simd_select_bitmask("x", x, x); + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +error: aborting due to 6 previous errors For more information about this error, try `rustc --explain E0511`. |
