This repository was archived by the owner on May 28, 2025. It is now read-only.
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>(
691691 }
692692}
693693
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 .
697697const KNOWN_DIRECTIVE_NAMES : & [ & str ] = & [
698698 // tidy-alphabetical-start
699699 "assembly-output" ,
@@ -837,6 +837,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
837837 "needs-sanitizer-thread" ,
838838 "needs-threads" ,
839839 "needs-unwind" ,
840+ "needs-wasmtime" ,
840841 "needs-xray" ,
841842 "no-prefer-dynamic" ,
842843 "normalize-stderr-32bit" ,
@@ -872,6 +873,7 @@ const KNOWN_DIRECTIVE_NAMES: &[&str] = &[
872873 "only-unix" ,
873874 "only-wasm32" ,
874875 "only-wasm32-bare" ,
876+ "only-wasm32-wasip1" ,
875877 "only-windows" ,
876878 "only-x86" ,
877879 "only-x86_64" ,
Original file line number Diff line number Diff line change @@ -149,6 +149,11 @@ pub(super) fn handle_needs(
149149 condition : config. target_cfg ( ) . relocation_model == "pic" ,
150150 ignore_reason : "ignored on targets without PIC relocation model" ,
151151 } ,
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+ } ,
152157 ] ;
153158
154159 let ( name, comment) = match ln. split_once ( [ ':' , ' ' ] ) {
Original file line number Diff line number Diff line change 88//! settings. Turning off optimizations and enabling debug assertions tends to produce the most
99//! dependence on core that is possible, so that is the configuration we test here.
1010
11+ // wasm and nvptx targets don't produce rlib files that object can parse.
12+ //@ ignore-wasm
13+ //@ ignore-nvptx64
14+
1115#![ deny( warnings) ]
1216
1317extern crate run_make_support;
@@ -33,10 +37,6 @@ path = "lib.rs""#;
3337fn main ( ) {
3438 let target_dir = tmp_dir ( ) . join ( "target" ) ;
3539 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- }
4040
4141 println ! ( "Testing compiler_builtins for {}" , target) ;
4242
Original file line number Diff line number Diff line change 1+ //@ only-wasm32-wasip1
2+ //@ needs-wasmtime
3+
14extern crate run_make_support;
25
36use run_make_support:: { rustc, tmp_dir} ;
47use std:: path:: Path ;
58use std:: process:: Command ;
69
710fn main ( ) {
8- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
9- return ;
10- }
11-
1211 rustc ( ) . input ( "foo.rs" ) . target ( "wasm32-wasip1" ) . run ( ) ;
1312
1413 let file = tmp_dir ( ) . join ( "foo.wasm" ) ;
1514
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-
2515 run ( & file, "return_two_i32" , "1\n 2\n " ) ;
2616 run ( & file, "return_two_i64" , "3\n 4\n " ) ;
2717 run ( & file, "return_two_f32" , "5\n 6\n " ) ;
Original file line number Diff line number Diff line change 1+ //@ only-wasm32-wasip1
12extern crate run_make_support;
23
34use run_make_support:: { rustc, tmp_dir, wasmparser} ;
45use std:: collections:: HashMap ;
56
67fn main ( ) {
7- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
8- return ;
9- }
10-
118 rustc ( ) . input ( "foo.rs" ) . target ( "wasm32-wasip1" ) . run ( ) ;
129 rustc ( ) . input ( "bar.rs" ) . target ( "wasm32-wasip1" ) . arg ( "-Clto" ) . opt ( ) . run ( ) ;
1310
Original file line number Diff line number Diff line change 1+ //@ only-wasm32-wasip1
12extern crate run_make_support;
23
34use run_make_support:: { tmp_dir, wasmparser, rustc} ;
45use std:: collections:: HashMap ;
56use std:: path:: Path ;
67
78fn main ( ) {
8- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
9- return ;
10- }
11-
129 rustc ( ) . input ( "foo.rs" ) . target ( "wasm32-wasip1" ) . opt ( ) . run ( ) ;
1310
1411 verify ( & tmp_dir ( ) . join ( "foo.wasm" ) ) ;
Original file line number Diff line number Diff line change 1+ //@ only-wasm32-wasip1
2+
13extern crate run_make_support;
24
35use run_make_support:: { tmp_dir, wasmparser, rustc} ;
@@ -6,10 +8,6 @@ use std::path::Path;
68use wasmparser:: ExternalKind :: * ;
79
810fn main ( ) {
9- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
10- return ;
11- }
12-
1311 test ( & [ ] ) ;
1412 test ( & [ "-O" ] ) ;
1513 test ( & [ "-Clto" ] ) ;
Original file line number Diff line number Diff line change 1+ //@ only-wasm32-wasip1
2+
13extern crate run_make_support;
24
35use run_make_support:: { tmp_dir, wasmparser, rustc} ;
46use std:: collections:: HashMap ;
57use wasmparser:: TypeRef :: Func ;
68
79fn main ( ) {
8- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
9- return ;
10- }
11-
1210 rustc ( ) . input ( "foo.rs" ) . target ( "wasm32-wasip1" ) . run ( ) ;
1311 rustc ( )
1412 . input ( "bar.rs" )
Original file line number Diff line number Diff line change 1+ //@ only-wasm32-wasip1
12#![ deny( warnings) ]
23
34extern crate run_make_support;
45
56use run_make_support:: { rustc, tmp_dir} ;
67
78fn main ( ) {
8- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
9- return ;
10- }
11-
129 test ( "a" ) ;
1310 test ( "b" ) ;
1411 test ( "c" ) ;
Original file line number Diff line number Diff line change 1+ //@ only-wasm32-wasip1
2+
13extern crate run_make_support;
24
35use run_make_support:: { rustc, tmp_dir, wasmparser} ;
46use std:: collections:: HashMap ;
57
68fn main ( ) {
7- if std:: env:: var ( "TARGET" ) . unwrap ( ) != "wasm32-wasip1" {
8- return ;
9- }
10-
119 rustc ( )
1210 . input ( "main.rs" )
1311 . target ( "wasm32-wasip1" )
You can’t perform that action at this time.
0 commit comments