forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test for more SIMD monomorphization errors
build-fail test for simd type with an element type that's a wide pointer test for SIMD element type of optional nonnull ptr to extern type test that wide ptr simd element type of *mut [u8] fails
- Loading branch information
1 parent
3d738b0
commit d9a5df6
Showing
5 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
src/test/ui/simd/simd-type-generic-monomorphisation-extern-nonnull-ptr.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// run-pass | ||
// ignore-emscripten | ||
|
||
#![feature(extern_types)] | ||
#![feature(repr_simd)] | ||
|
||
use std::ptr::NonNull; | ||
|
||
extern { | ||
type Extern; | ||
} | ||
|
||
#[repr(simd)] | ||
struct S<T>(T); | ||
|
||
#[inline(never)] | ||
fn identity<T>(v: T) -> T { | ||
v | ||
} | ||
|
||
fn main() { | ||
let _v: S<[Option<NonNull<Extern>>; 4]> = identity(S([None; 4])); | ||
} |
12 changes: 12 additions & 0 deletions
12
src/test/ui/simd/simd-type-generic-monomorphisation-wide-ptr.rs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// build-fail | ||
|
||
#![feature(repr_simd)] | ||
|
||
// error-pattern:monomorphising SIMD type `S<[*mut [u8]; 4]>` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]` | ||
|
||
#[repr(simd)] | ||
struct S<T>(T); | ||
|
||
fn main() { | ||
let _v: Option<S<[*mut [u8]; 4]>> = None; | ||
} |
4 changes: 4 additions & 0 deletions
4
src/test/ui/simd/simd-type-generic-monomorphisation-wide-ptr.stderr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
error: monomorphising SIMD type `S<[*mut [u8]; 4]>` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]` | ||
|
||
error: aborting due to previous error | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
// build-fail | ||
|
||
#![feature(repr_simd)] | ||
|
||
// error-pattern:monomorphising SIMD type `S` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]` | ||
|
||
#[repr(simd)] | ||
struct S([*mut [u8]; 4]); | ||
|
||
fn main() { | ||
let _v: Option<S> = None; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
error: monomorphising SIMD type `S` with a non-primitive-scalar (integer/float/pointer) element type `*mut [u8]` | ||
|
||
error: aborting due to previous error | ||
|