Upgrade Emscripten targets to use upstream LLVM backend

- Compatible with Emscripten 1.38.46-upstream or later upstream.
 - Refactors the Emscripten target spec to share code with other wasm
   targets.
 - Replaces the old incorrect wasm32 C call ABI with the correct one,
   preserving the old one as wasm32_bindgen_compat for wasm-bindgen
   compatibility.
 - Updates the varargs ABI used by Emscripten and deletes the old one.
 - Removes the obsolete wasm32-experimental-emscripten target.
 - Uses EMCC_CFLAGS on CI to avoid the timeout problems with #63649.
This commit is contained in:
Thomas Lively 2019-08-16 22:08:01 -07:00
parent 0e8a4b441c
commit 2bf59bea48
144 changed files with 378 additions and 538 deletions

View file

@ -5,6 +5,10 @@
// ignore-wasm32-bare no libc to test ffi with
// FIXME: This will work on emscripten once libc is updated to include
// rust-lang/libc/#1478
// ignore-emscripten libc type mismatch
#![feature(rustc_private)]
extern crate libc;

View file

@ -7,7 +7,7 @@
//
// See issue #59123 for a full explanation.
// ignore-wasm32-bare (sizes don't match)
// ignore-emscripten (sizes don't match)
// run-pass
// edition:2018

View file

@ -4,7 +4,7 @@
// What we don't want to see is the wrong multiple of 1024 (the size of `Big`)
// being reflected in the size.
// ignore-wasm32-bare (sizes don't match)
// ignore-emscripten (sizes don't match)
// run-pass
// edition:2018

View file

@ -3,6 +3,7 @@
// compile-flags: -Copt-level=z -Cdebuginfo=2 --edition=2018
// run-pass
// ignore-asmjs wasm2js does not support source maps yet
use std::future::Future;
use std::task::Poll;

View file

@ -2,7 +2,7 @@
// Check that partially moved from function parameters are dropped after the
// named bindings that move from them.
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
use std::{panic, cell::RefCell};

View file

@ -1,6 +1,7 @@
// run-pass
#![allow(dead_code)]
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
#[derive(PartialEq, Eq)]
struct NewBool(bool);

View file

@ -2,7 +2,7 @@
#![allow(unused_variables)]
#![allow(unused_imports)]
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// Test that builtin implementations of `Clone` cleanup everything
// in case of unwinding.

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
fn worker() -> ! {
panic!()

View file

@ -1,5 +1,4 @@
// run-pass
// ignore-emscripten no i128 support
#![feature(const_saturating_int_methods)]
const INT_U32_NO: u32 = (42 as u32).saturating_add(2);

View file

@ -7,6 +7,7 @@
// aux-build:debuginfo-lto-aux.rs
// compile-flags: -C lto -g
// no-prefer-dynamic
// ignore-asmjs wasm2js does not support source maps yet
extern crate debuginfo_lto_aux;

View file

@ -5,7 +5,7 @@
// run-pass
// edition:2018
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![feature(slice_patterns)]
#![allow(unused)]

View file

@ -2,7 +2,7 @@
#![allow(unused_assignments)]
#![allow(unused_variables)]
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![feature(generators, generator_trait, untagged_unions)]
#![feature(slice_patterns)]

View file

@ -5,7 +5,8 @@
// compile. To sidestep this by using one that *is* defined.
// run-rustfix
// ignore-wasm32 no external library to link to.
// ignore-wasm32-bare no external library to link to.
// ignore-asmjs wasm2js does not support source maps yet
// compile-flags: -g
#![feature(rustc_private)]
extern crate libc;

View file

@ -5,7 +5,8 @@
// compile. To sidestep this by using one that *is* defined.
// run-rustfix
// ignore-wasm32 no external library to link to.
// ignore-wasm32-bare no external library to link to.
// ignore-asmjs wasm2js does not support source maps yet
// compile-flags: -g
#![feature(rustc_private)]
extern crate libc;

View file

@ -1,5 +1,5 @@
error: extern items cannot be `const`
--> $DIR/extern-const.rs:15:5
--> $DIR/extern-const.rs:16:5
|
LL | const rust_dbg_static_mut: libc::c_int;
| ^^^^^ help: try using a static value: `static`

View file

@ -1,3 +1,4 @@
// ignore-emscripten compiled with panic=abort by default
// compile-flags: -C no-prepopulate-passes -Cpasses=name-anon-globals
#![crate_type = "lib"]

View file

@ -1,5 +1,6 @@
// run-pass
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
#![feature(generators, generator_trait)]

View file

@ -1,6 +1,6 @@
// run-pass
// ignore-wasm32-bare compiled as panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![feature(generators, generator_trait)]

View file

@ -1,6 +1,6 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![feature(generators, generator_trait)]

View file

@ -1,6 +1,6 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![feature(generators, generator_trait)]

View file

@ -11,6 +11,7 @@
// edition:2018
// ignore-wasm32 issue #62807
// ignore-asmjs issue #62807
#![feature(generators, generator_trait)]

View file

@ -1,5 +1,4 @@
// run-pass
// ignore-emscripten no i128 support
#![feature(intrinsics)]

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare always compiled as panic=abort right now
// ignore-emscripten compiled with panic=abort by default
// Check that values are not leaked when a dtor panics (#14875)

View file

@ -1,4 +1,5 @@
// build-pass
// ignore-asmjs wasm2js does not support source maps yet
// compile-flags: -g
pub struct Dst {

View file

@ -1,6 +1,7 @@
// run-pass
// aux-build:issue-24687-lib.rs
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
extern crate issue_24687_lib as d;

View file

@ -3,6 +3,7 @@
// as options to the compiler.
// compile-flags:-g -g -O -O
// ignore-asmjs wasm2js does not support source maps yet
fn main() {
assert_eq!(1, 1);

View file

@ -1,5 +1,6 @@
// run-pass
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
fn helper<F: FnOnce(usize) -> bool>(_f: F) {
print!("");

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
use std::panic;

View file

@ -1,5 +1,6 @@
// run-pass
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
use std::ops::Deref;

View file

@ -1,7 +1,7 @@
// run-pass
// ignore-windows
// ignore-macos
// ignore-wasm32-bare common linkage not implemented right now
// ignore-emscripten common linkage not implemented right now
#![feature(linkage)]

View file

@ -1,5 +1,6 @@
// run-pass
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
// In this test we just want to make sure that the code below does not lead to
// a debuginfo verification assertion during compilation. This was caused by the

View file

@ -2,6 +2,7 @@
// Regression test for #36856.
// compile-flags:-g
// ignore-asmjs wasm2js does not support source maps yet
fn g() -> bool {
false

View file

@ -2,6 +2,7 @@
// Regression test for #42210.
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
trait Foo {
fn foo() { }

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
use std::panic;

View file

@ -1,6 +1,7 @@
// run-pass
#![allow(unused_variables)]
// compile-flags:--test -g
// ignore-asmjs wasm2js does not support source maps yet
#[cfg(target_os = "macos")]
#[test]

View file

@ -1,6 +1,8 @@
// run-pass
// compile-flags:--test -O
// ignore-emscripten compiled with panic=abort by default
#[test]
#[should_panic(expected = "creating inhabited type")]
fn test() {

View file

@ -8,6 +8,7 @@
// compile-flags:-g
// ignore-pretty issue #37195
// ignore-asmjs wasm2js does not support source maps yet
#![feature(non_ascii_idents)]

View file

@ -1,5 +1,4 @@
// build-pass (FIXME(62277): could be check-pass?)
// ignore-emscripten no i128 support
fn fibs(n: u32) -> impl Iterator<Item=u128> {
(0 .. n)

View file

@ -1,5 +1,7 @@
// run-pass
// compile-flags:-C debuginfo=2
// ignore-asmjs wasm2js does not support source maps yet
fn foo() -> impl Copy {
foo
}

View file

@ -1,6 +1,6 @@
// run-pass
// only-32bit too impatient for 2⁶⁴ items
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes -C opt-level=3
use std::panic;

View file

@ -1,6 +1,6 @@
// run-pass
// only-32bit too impatient for 2⁶⁴ items
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes -C opt-level=3
use std::panic;

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes
use std::panic;

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// compile-flags: -C debug_assertions=yes
use std::panic;

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// compile-flags: -C overflow-checks
use std::panic;

View file

@ -13,6 +13,8 @@
// compile-flags: --test -C debug_assertions=yes
// revisions: std core
// ignore-emscripten compiled with panic=abort by default
#![cfg_attr(core, no_std)]
#[cfg(std)] use std::fmt;

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![feature(fn_traits)]
#![feature(never_type)]

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
use std::cell::RefCell;
use std::panic;

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare always compiled as panic=abort right now and this requires unwinding
// ignore-emscripten compiled with panic=abort by default
// This test checks that instantiating an uninhabited type via `mem::{uninitialized,zeroed}` results
// in a runtime panic.

View file

@ -1,5 +1,4 @@
// run-pass
// ignore-emscripten no i128 support
#![deny(const_err)]

View file

@ -1,9 +1,6 @@
// run-pass
#![allow(overflowing_literals)]
// ignore-emscripten i128 doesn't work
#![feature(test)]
extern crate test;

View file

@ -1,6 +1,6 @@
// run-pass
// compile-flags: -C debug_assertions=yes
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// ignore-emscripten dies with an LLVM error
use std::panic;

View file

@ -1,5 +1,4 @@
// run-pass
// ignore-emscripten u128 not supported
#![feature(test)]
#![deny(overflowing_literals)]

View file

@ -1,6 +1,4 @@
// run-pass
// ignore-emscripten u128 not supported
#![feature(test)]

View file

@ -4,7 +4,7 @@
// aux-build:wants-panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
// error-pattern: is not compiled with this crate's panic strategy `unwind`
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![no_std]
#![no_main]

View file

@ -1,7 +1,7 @@
// error-pattern:is incompatible with this crate's strategy of `unwind`
// aux-build:panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![no_std]
#![no_main]

View file

@ -2,7 +2,7 @@
// aux-build:panic-runtime-abort.rs
// aux-build:wants-panic-runtime-abort.rs
// aux-build:panic-runtime-lang-items.rs
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![no_std]
#![no_main]

View file

@ -1,7 +1,7 @@
// run-pass
// aux-build:expand-with-a-macro.rs
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![deny(warnings)]

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// aux-build:reachable-unnameable-items.rs
extern crate reachable_unnameable_items;

View file

@ -1,6 +1,8 @@
// compile-flags: --test
// run-pass
// ignore-emscripten compiled with panic=abort by default
#![feature(test)]
extern crate test;

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
#![allow(dead_code, unreachable_code)]

View file

@ -4,6 +4,7 @@
// 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;

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// compile-flags: --test
#![feature(allow_fail)]

View file

@ -1,5 +1,5 @@
// run-pass
// ignore-wasm32-bare compiled with panic=abort by default
// ignore-emscripten compiled with panic=abort by default
// compile-flags: --test
#[test]
#[should_panic(expected = "foo")]

View file

@ -10,6 +10,7 @@
// This is a regression test for issue #17021.
//
// compile-flags: -g
// ignore-asmjs wasm2js does not support source maps yet
use std::ptr;