File tree Expand file tree Collapse file tree 14 files changed +30
-60
lines changed
src/tools/compiletest/src
wasm-stringify-ints-small
wasm-symbols-different-module
wasm-symbols-not-exported
wasm-symbols-not-imported Expand file tree Collapse file tree 14 files changed +30
-60
lines changed Original file line number Diff line number Diff line change @@ -691,9 +691,9 @@ pub fn line_directive<'line>(
691
691
}
692
692
}
693
693
694
- /// This is generated by collecting directives from ui tests and then extracting their directive
695
- /// names. This is **not** an exhaustive list of all possible directives. Instead, this is a
696
- /// best-effort approximation for diagnostics.
694
+ /// This was originally generated by collecting directives from ui tests and then extracting their
695
+ /// directive names. This is **not** an exhaustive list of all possible directives. Instead, this is
696
+ /// a best-effort approximation for diagnostics. Add new headers to this list when needed .
697
697
const KNOWN_DIRECTIVE_NAMES : & [ & str ] = & [
698
698
// tidy-alphabetical-start
699
699
"assembly-output" ,
@@ -837,6 +837,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
837
837
"needs-sanitizer-thread" ,
838
838
"needs-threads" ,
839
839
"needs-unwind" ,
840
+ "needs-wasmtime" ,
840
841
"needs-xray" ,
841
842
"no-prefer-dynamic" ,
842
843
"normalize-stderr-32bit" ,
@@ -872,6 +873,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
872
873
"only-unix" ,
873
874
"only-wasm32" ,
874
875
"only-wasm32-bare" ,
876
+ "only-wasm32-wasip1" ,
875
877
"only-windows" ,
876
878
"only-x86" ,
877
879
"only-x86_64" ,
Original file line number Diff line number Diff line change @@ -149,6 +149,11 @@ pub(super) fn handle_needs(
149
149
condition : config. target_cfg ( ) . relocation_model == "pic" ,
150
150
ignore_reason : "ignored on targets without PIC relocation model" ,
151
151
} ,
152
+ Need {
153
+ name : "needs-wasmtime" ,
154
+ condition : config. runner . as_ref ( ) . is_some_and ( |r| r. contains ( "wasmtime" ) ) ,
155
+ ignore_reason : "ignored when wasmtime runner is not available" ,
156
+ } ,
152
157
] ;
153
158
154
159
let ( name, comment) = match ln. split_once ( [ ':' , ' ' ] ) {
Original file line number Diff line number Diff line change 8
8
//! settings. Turning off optimizations and enabling debug assertions tends to produce the most
9
9
//! dependence on core that is possible, so that is the configuration we test here.
10
10
11
+ // wasm and nvptx targets don't produce rlib files that object can parse.
12
+ //@ ignore-wasm
13
+ //@ ignore-nvptx64
14
+
11
15
#![ deny( warnings) ]
12
16
13
17
extern crate run_make_support;
@@ -33,10 +37,6 @@ path = "lib.rs""#;
33
37
fn main ( ) {
34
38
let target_dir = tmp_dir ( ) . join ( "target" ) ;
35
39
let target = std:: env:: var ( "TARGET" ) . unwrap ( ) ;
36
- if target. starts_with ( "wasm" ) || target. starts_with ( "nvptx" ) {
37
- // wasm and nvptx targets don't produce rlib files that object can parse.
38
- return ;
39
- }
40
40
41
41
println ! ( "Testing compiler_builtins for {}" , target) ;
42
42
Original file line number Diff line number Diff line change
1
+ //@ only-wasm32-wasip1
2
+ //@ needs-wasmtime
3
+
1
4
extern crate run_make_support;
2
5
3
6
use run_make_support:: { rustc, tmp_dir} ;
4
7
use std:: path:: Path ;
5
8
use std:: process:: Command ;
6
9
7
10
fn main ( ) {
8
- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
9
- return ;
10
- }
11
-
12
11
rustc ( ) . input ( "foo.rs" ) . target ( "wasm32-wasip1" ) . run ( ) ;
13
12
14
13
let file = tmp_dir ( ) . join ( "foo.wasm" ) ;
15
14
16
- let has_wasmtime = match Command :: new ( "wasmtime" ) . arg ( "--version" ) . output ( ) {
17
- Ok ( s) => s. status . success ( ) ,
18
- _ => false ,
19
- } ;
20
- if !has_wasmtime {
21
- println ! ( "skipping test, wasmtime isn't available" ) ;
22
- return ;
23
- }
24
-
25
15
run ( & file, "return_two_i32" , "1\n 2\n " ) ;
26
16
run ( & file, "return_two_i64" , "3\n 4\n " ) ;
27
17
run ( & file, "return_two_f32" , "5\n 6\n " ) ;
Original file line number Diff line number Diff line change
1
+ //@ only-wasm32-wasip1
1
2
extern crate run_make_support;
2
3
3
4
use run_make_support:: { rustc, tmp_dir, wasmparser} ;
4
5
use std:: collections:: HashMap ;
5
6
6
7
fn main ( ) {
7
- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
8
- return ;
9
- }
10
-
11
8
rustc ( ) . input ( "foo.rs" ) . target ( "wasm32-wasip1" ) . run ( ) ;
12
9
rustc ( ) . input ( "bar.rs" ) . target ( "wasm32-wasip1" ) . arg ( "-Clto" ) . opt ( ) . run ( ) ;
13
10
Original file line number Diff line number Diff line change
1
+ //@ only-wasm32-wasip1
1
2
extern crate run_make_support;
2
3
3
4
use run_make_support:: { tmp_dir, wasmparser, rustc} ;
4
5
use std:: collections:: HashMap ;
5
6
use std:: path:: Path ;
6
7
7
8
fn main ( ) {
8
- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
9
- return ;
10
- }
11
-
12
9
rustc ( ) . input ( "foo.rs" ) . target ( "wasm32-wasip1" ) . opt ( ) . run ( ) ;
13
10
14
11
verify ( & tmp_dir ( ) . join ( "foo.wasm" ) ) ;
Original file line number Diff line number Diff line change
1
+ //@ only-wasm32-wasip1
2
+
1
3
extern crate run_make_support;
2
4
3
5
use run_make_support:: { tmp_dir, wasmparser, rustc} ;
@@ -6,10 +8,6 @@ use std::path::Path;
6
8
use wasmparser:: ExternalKind :: * ;
7
9
8
10
fn main ( ) {
9
- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
10
- return ;
11
- }
12
-
13
11
test ( & [ ] ) ;
14
12
test ( & [ "-O" ] ) ;
15
13
test ( & [ "-Clto" ] ) ;
Original file line number Diff line number Diff line change
1
+ //@ only-wasm32-wasip1
2
+
1
3
extern crate run_make_support;
2
4
3
5
use run_make_support:: { tmp_dir, wasmparser, rustc} ;
4
6
use std:: collections:: HashMap ;
5
7
use wasmparser:: TypeRef :: Func ;
6
8
7
9
fn main ( ) {
8
- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
9
- return ;
10
- }
11
-
12
10
rustc ( ) . input ( "foo.rs" ) . target ( "wasm32-wasip1" ) . run ( ) ;
13
11
rustc ( )
14
12
. input ( "bar.rs" )
Original file line number Diff line number Diff line change
1
+ //@ only-wasm32-wasip1
1
2
#![ deny( warnings) ]
2
3
3
4
extern crate run_make_support;
4
5
5
6
use run_make_support:: { rustc, tmp_dir} ;
6
7
7
8
fn main ( ) {
8
- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
9
- return ;
10
- }
11
-
12
9
test ( "a" ) ;
13
10
test ( "b" ) ;
14
11
test ( "c" ) ;
Original file line number Diff line number Diff line change
1
+ //@ only-wasm32-wasip1
2
+
1
3
extern crate run_make_support;
2
4
3
5
use run_make_support:: { rustc, tmp_dir, wasmparser} ;
4
6
use std:: collections:: HashMap ;
5
7
6
8
fn main ( ) {
7
- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
8
- return ;
9
- }
10
-
11
9
rustc ( )
12
10
. input ( "main.rs" )
13
11
. target ( "wasm32-wasip1" )
You can’t perform that action at this time.
0 commit comments