Auto merge of #81451 - nikic:llvm-12, r=nagisa

Upgrade to LLVM 12

This implements the necessary adjustments to make rustc work with LLVM 12. I didn't encounter any major issues so far.

r? `@cuviper`
This commit is contained in:
bors 2021-03-04 15:16:44 +00:00
commit 409920873c
57 changed files with 402 additions and 101 deletions

View file

@ -383,6 +383,8 @@ fn configure_cmake(
cfg.define("CMAKE_SYSTEM_NAME", "Windows");
} else if target.contains("haiku") {
cfg.define("CMAKE_SYSTEM_NAME", "Haiku");
} else if target.contains("solaris") || target.contains("illumos") {
cfg.define("CMAKE_SYSTEM_NAME", "SunOS");
}
// When cross-compiling we should also set CMAKE_SYSTEM_VERSION, but in
// that case like CMake we cannot easily determine system version either.

View file

@ -36,5 +36,8 @@ ENV SCRIPT python3 ../x.py --stage 2 test --host='' --target $TARGETS
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
COPY scripts/android-start-emulator.sh /scripts/
ENTRYPOINT ["/scripts/android-start-emulator.sh"]

View file

@ -24,6 +24,9 @@ USER root
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/aarch64-unknown-linux-gnueabi/bin
ENV CC_aarch64_unknown_linux_gnu=aarch64-unknown-linux-gnueabi-gcc \

View file

@ -36,3 +36,6 @@ ENV SCRIPT python3 ../x.py dist --host='' --target $TARGETS
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh

View file

@ -27,6 +27,9 @@ USER root
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabi/bin
ENV CC_arm_unknown_linux_gnueabi=arm-unknown-linux-gnueabi-gcc \

View file

@ -19,6 +19,9 @@ USER root
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/arm-unknown-linux-gnueabihf/bin
ENV CC_arm_unknown_linux_gnueabihf=arm-unknown-linux-gnueabihf-gcc \

View file

@ -19,6 +19,9 @@ USER root
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/armv7-unknown-linux-gnueabihf/bin
ENV CC_armv7_unknown_linux_gnueabihf=armv7-unknown-linux-gnueabihf-gcc \

View file

@ -30,6 +30,9 @@ RUN CC=gcc CFLAGS="-m32 -Wa,-mrelax-relocations=no" \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV RUST_CONFIGURE_ARGS \
--musl-root-i586=/musl-i586 \
--musl-root-i686=/musl-i686 \

View file

@ -68,11 +68,13 @@ RUN ./build-binutils.sh
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
RUN ./build-gcc.sh && apt-get remove -y gcc g++
# Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
RUN ./build-python.sh
# Build Python 2.7 needed for Clang 10.
RUN ./build-python.sh 2.7.12
# Build Python 3 needed for LLVM 12.
RUN ./build-python.sh 3.9.1
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
# LLVM needs cmake 3.13.4 or higher.
COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
RUN ./build-cmake.sh

View file

@ -21,6 +21,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV HOSTS=mips-unknown-linux-gnu
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs

View file

@ -20,6 +20,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV HOSTS=mips64-unknown-linux-gnuabi64
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs

View file

@ -21,6 +21,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV HOSTS=mips64el-unknown-linux-gnuabi64
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs

View file

@ -20,6 +20,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV HOSTS=mipsel-unknown-linux-gnu
ENV RUST_CONFIGURE_ARGS --enable-extended --disable-docs

View file

@ -25,6 +25,9 @@ USER root
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/powerpc-unknown-linux-gnu/bin
ENV \

View file

@ -26,6 +26,9 @@ USER root
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/powerpc64-unknown-linux-gnu/bin
ENV \

View file

@ -25,6 +25,9 @@ RUN ./build-powerpc64le-toolchain.sh
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV \
AR_powerpc64le_unknown_linux_gnu=powerpc64le-linux-gnu-ar \
CC_powerpc64le_unknown_linux_gnu=powerpc64le-linux-gnu-gcc \

View file

@ -19,6 +19,9 @@ USER root
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/riscv64-unknown-linux-gnu/bin
ENV CC_riscv64gc_unknown_linux_gnu=riscv64-unknown-linux-gnu-gcc \

View file

@ -25,6 +25,9 @@ USER root
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/s390x-ibm-linux-gnu/bin
ENV \

View file

@ -23,6 +23,9 @@ RUN /tmp/freebsd-toolchain.sh x86_64
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV \
AR_x86_64_unknown_freebsd=x86_64-unknown-freebsd11-ar \
CC_x86_64_unknown_freebsd=x86_64-unknown-freebsd11-clang \

View file

@ -22,6 +22,9 @@ RUN bash /tmp/illumos-toolchain.sh x86_64 gcc
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV \
AR_x86_64_unknown_illumos=x86_64-illumos-ar \
CC_x86_64_unknown_illumos=x86_64-illumos-gcc \

View file

@ -68,11 +68,13 @@ RUN ./build-binutils.sh
COPY host-x86_64/dist-x86_64-linux/build-gcc.sh /tmp/
RUN ./build-gcc.sh && apt-get remove -y gcc g++
# Debian 6 has Python 2.6 by default, but LLVM needs 2.7+
COPY host-x86_64/dist-x86_64-linux/build-python.sh /tmp/
RUN ./build-python.sh
# Build Python 2.7 needed for Clang 10.
RUN ./build-python.sh 2.7.12
# Build Python 3 needed for LLVM 12.
RUN ./build-python.sh 3.9.1
# LLVM needs cmake 3.4.3 or higher, and is planning to raise to 3.13.4.
# LLVM needs cmake 3.13.4 or higher.
COPY host-x86_64/dist-x86_64-linux/build-cmake.sh /tmp/
RUN ./build-cmake.sh

View file

@ -3,7 +3,8 @@
set -ex
source shared.sh
curl https://www.python.org/ftp/python/2.7.12/Python-2.7.12.tgz | \
VERSION=$1
curl https://www.python.org/ftp/python/$VERSION/Python-$VERSION.tgz | \
tar xzf -
mkdir python-build
@ -12,10 +13,10 @@ cd python-build
# Gotta do some hackery to tell python about our custom OpenSSL build, but other
# than that fairly normal.
CFLAGS='-I /rustroot/include' LDFLAGS='-L /rustroot/lib -L /rustroot/lib64' \
hide_output ../Python-2.7.12/configure --prefix=/rustroot
hide_output ../Python-$VERSION/configure --prefix=/rustroot
hide_output make -j10
hide_output make install
cd ..
rm -rf python-build
rm -rf Python-2.7.12
rm -rf Python-$VERSION

View file

@ -20,6 +20,10 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /build/
# Build cmake before musl toolchain, as we replace the compiler during that step.
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
COPY scripts/musl-toolchain.sh /build/
# We need to mitigate rust-lang/rust#34978 when compiling musl itself as well
RUN CFLAGS="-Wa,-mrelax-relocations=no -Wa,--compress-debug-sections=none -Wl,--compress-debug-sections=none" \

View file

@ -9,6 +9,9 @@ RUN /tmp/build-netbsd-toolchain.sh
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV PATH=$PATH:/x-tools/x86_64-unknown-netbsd/bin
ENV \

View file

@ -20,6 +20,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
RUN mkdir -p /config
RUN echo "[rust]" > /config/nopt-std-config.toml
RUN echo "optimize = false" >> /config/nopt-std-config.toml

View file

@ -20,6 +20,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV RUST_CONFIGURE_ARGS --build=i686-unknown-linux-gnu
# Exclude some tests that are unlikely to be platform specific, to speed up
# this slow job.

View file

@ -42,5 +42,8 @@ RUN npm install browser-ui-test -g --unsafe-perm=true
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu
ENV RUST_CHECK_TARGET check-aux-and-gui

View file

@ -19,6 +19,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
ENV RUST_CONFIGURE_ARGS --build=x86_64-unknown-linux-gnu --set rust.ignore-git=false
ENV SCRIPT python3 ../x.py --stage 2 test distcheck
ENV DIST_SRC 1

View file

@ -18,6 +18,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
COPY scripts/sccache.sh /scripts/
RUN sh /scripts/sccache.sh
COPY scripts/cmake.sh /scripts/
RUN /scripts/cmake.sh
COPY host-x86_64/x86_64-gnu-tools/checktools.sh /tmp/
ENV RUST_CONFIGURE_ARGS \

34
src/ci/docker/scripts/cmake.sh Executable file
View file

@ -0,0 +1,34 @@
#!/bin/bash
set -ex
hide_output() {
set +x
on_err="
echo ERROR: An error was encountered with the build.
cat /tmp/build.log
exit 1
"
trap "$on_err" ERR
bash -c "while true; do sleep 30; echo \$(date) - building ...; done" &
PING_LOOP_PID=$!
"$@" &> /tmp/build.log
trap - ERR
kill $PING_LOOP_PID
rm /tmp/build.log
set -x
}
# LLVM 12 requires CMake 3.13.4 or higher.
# This script is not necessary for images using Ubuntu 20.04 or newer.
CMAKE=3.13.4
curl -L https://github.com/Kitware/CMake/releases/download/v$CMAKE/cmake-$CMAKE.tar.gz | tar xzf -
mkdir cmake-build
cd cmake-build
hide_output ../cmake-$CMAKE/configure
hide_output make -j$(nproc)
hide_output make install
cd ..
rm -rf cmake-build
rm -rf cmake-$CMAKE

@ -1 +1 @@
Subproject commit 96ae8953e4938d39c4173dd189f268459fff8c02
Subproject commit 40618a2340ac2939b3dc320a9fe1133fa5caa345

View file

@ -5,6 +5,7 @@
//[riscv32] compile-flags: --target riscv32imac-unknown-none-elf
// compile-flags: -C target-feature=+d
// needs-llvm-components: riscv
// min-system-llvm-version: 12.0
#![feature(no_core, lang_items, rustc_attrs)]
#![crate_type = "rlib"]
@ -99,45 +100,45 @@ macro_rules! check_reg {
// CHECK-LABEL: reg_i8:
// CHECK: #APP
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
// CHECK: #NO_APP
check!(reg_i8 i8 reg "mv");
// CHECK-LABEL: reg_i16:
// CHECK: #APP
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
// CHECK: #NO_APP
check!(reg_i16 i16 reg "mv");
// CHECK-LABEL: reg_i32:
// CHECK: #APP
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
// CHECK: #NO_APP
check!(reg_i32 i32 reg "mv");
// CHECK-LABEL: reg_f32:
// CHECK: #APP
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
// CHECK: #NO_APP
check!(reg_f32 f32 reg "mv");
// riscv64-LABEL: reg_i64:
// riscv64: #APP
// riscv64: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
// riscv64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
// riscv64: #NO_APP
#[cfg(riscv64)]
check!(reg_i64 i64 reg "mv");
// riscv64-LABEL: reg_f64:
// riscv64: #APP
// riscv64: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
// riscv64: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
// riscv64: #NO_APP
#[cfg(riscv64)]
check!(reg_f64 f64 reg "mv");
// CHECK-LABEL: reg_ptr:
// CHECK: #APP
// CHECK: add {{[a-z0-9]+}}, zero, {{[a-z0-9]+}}
// CHECK: mv {{[a-z0-9]+}}, {{[a-z0-9]+}}
// CHECK: #NO_APP
check!(reg_ptr ptr reg "mv");
@ -155,45 +156,45 @@ check!(freg_f64 f64 freg "fmv.d");
// CHECK-LABEL: a0_i8:
// CHECK: #APP
// CHECK: add a0, zero, a0
// CHECK: mv a0, a0
// CHECK: #NO_APP
check_reg!(a0_i8 i8 "a0" "mv");
// CHECK-LABEL: a0_i16:
// CHECK: #APP
// CHECK: add a0, zero, a0
// CHECK: mv a0, a0
// CHECK: #NO_APP
check_reg!(a0_i16 i16 "a0" "mv");
// CHECK-LABEL: a0_i32:
// CHECK: #APP
// CHECK: add a0, zero, a0
// CHECK: mv a0, a0
// CHECK: #NO_APP
check_reg!(a0_i32 i32 "a0" "mv");
// CHECK-LABEL: a0_f32:
// CHECK: #APP
// CHECK: add a0, zero, a0
// CHECK: mv a0, a0
// CHECK: #NO_APP
check_reg!(a0_f32 f32 "a0" "mv");
// riscv64-LABEL: a0_i64:
// riscv64: #APP
// riscv64: add a0, zero, a0
// riscv64: mv a0, a0
// riscv64: #NO_APP
#[cfg(riscv64)]
check_reg!(a0_i64 i64 "a0" "mv");
// riscv64-LABEL: a0_f64:
// riscv64: #APP
// riscv64: add a0, zero, a0
// riscv64: mv a0, a0
// riscv64: #NO_APP
#[cfg(riscv64)]
check_reg!(a0_f64 f64 "a0" "mv");
// CHECK-LABEL: a0_ptr:
// CHECK: #APP
// CHECK: add a0, zero, a0
// CHECK: mv a0, a0
// CHECK: #NO_APP
check_reg!(a0_ptr ptr "a0" "mv");

View file

@ -1,5 +1,6 @@
// compile-flags: -C no-prepopulate-passes
// ignore-tidy-linelength
// min-system-llvm-version: 12.0
#![crate_type = "lib"]
#![feature(rustc_attrs)]
@ -73,7 +74,7 @@ pub fn _box(x: Box<i32>) -> Box<i32> {
x
}
// CHECK: @struct_return(%S* noalias nocapture sret dereferenceable(32){{( %0)?}})
// CHECK: @struct_return(%S* noalias nocapture sret(%S) dereferenceable(32){{( %0)?}})
#[no_mangle]
pub fn struct_return() -> S {
S {

View file

@ -52,7 +52,7 @@ pub struct BigPacked2 {
#[no_mangle]
pub fn call_pkd1(f: fn() -> Array) -> BigPacked1 {
// CHECK: [[ALLOCA:%[_a-z0-9]+]] = alloca %Array
// CHECK: call void %{{.*}}(%Array* noalias nocapture sret dereferenceable(32) [[ALLOCA]])
// CHECK: call void %{{.*}}(%Array* noalias nocapture sret{{.*}} dereferenceable(32) [[ALLOCA]])
// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 1 %{{.*}}, i8* align 4 %{{.*}}, i{{[0-9]+}} 32, i1 false)
// check that calls whose destination is a field of a packed struct
// go through an alloca rather than calling the function with an
@ -64,7 +64,7 @@ pub fn call_pkd1(f: fn() -> Array) -> BigPacked1 {
#[no_mangle]
pub fn call_pkd2(f: fn() -> Array) -> BigPacked2 {
// CHECK: [[ALLOCA:%[_a-z0-9]+]] = alloca %Array
// CHECK: call void %{{.*}}(%Array* noalias nocapture sret dereferenceable(32) [[ALLOCA]])
// CHECK: call void %{{.*}}(%Array* noalias nocapture sret{{.*}} dereferenceable(32) [[ALLOCA]])
// CHECK: call void @llvm.memcpy.{{.*}}(i8* align 2 %{{.*}}, i8* align 4 %{{.*}}, i{{[0-9]+}} 32, i1 false)
// check that calls whose destination is a field of a packed struct
// go through an alloca rather than calling the function with an

View file

@ -1,7 +1,7 @@
// compile-flags: -C no-prepopulate-passes
// ignore-tidy-linelength
// min-system-llvm-version: 9.0
// min-system-llvm-version: 12.0
// ignore-arm
// ignore-aarch64
// ignore-mips
@ -34,19 +34,19 @@ pub enum TeBigS {
Variant(BigS),
}
// CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS:.*]], %BigS* [[BIGS_ARG_ATTRS1:.*]] byval(%BigS) [[BIGS_ARG_ATTRS2:.*]])
// CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], %BigS* [[BIGS_ARG_ATTRS1:.*]] byval(%BigS) [[BIGS_ARG_ATTRS2:.*]])
#[no_mangle]
pub extern "C" fn test_BigS(_: BigS) -> BigS { loop {} }
// CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS]], %TsBigS* [[BIGS_ARG_ATTRS1]] byval(%TsBigS) [[BIGS_ARG_ATTRS2:.*]])
// CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], %TsBigS* [[BIGS_ARG_ATTRS1]] byval(%TsBigS) [[BIGS_ARG_ATTRS2:.*]])
#[no_mangle]
pub extern "C" fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
// CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS]], %TuBigS* [[BIGS_ARG_ATTRS1]] byval(%TuBigS) [[BIGS_ARG_ATTRS2:.*]])
// CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], %TuBigS* [[BIGS_ARG_ATTRS1]] byval(%TuBigS) [[BIGS_ARG_ATTRS2:.*]])
#[no_mangle]
pub extern "C" fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
// CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS]], %"TeBigS::Variant"* [[BIGS_ARG_ATTRS1]] byval(%"TeBigS::Variant") [[BIGS_ARG_ATTRS2]])
// CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], %"TeBigS::Variant"* [[BIGS_ARG_ATTRS1]] byval(%"TeBigS::Variant") [[BIGS_ARG_ATTRS2]])
#[no_mangle]
pub extern "C" fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
@ -70,18 +70,18 @@ pub enum TeBigU {
Variant(BigU),
}
// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], %BigU* [[BIGU_ARG_ATTRS1:.*]] byval(%BigU) [[BIGU_ARG_ATTRS2:.*]])
// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], %BigU* [[BIGU_ARG_ATTRS1:.*]] byval(%BigU) [[BIGU_ARG_ATTRS2:.*]])
#[no_mangle]
pub extern "C" fn test_BigU(_: BigU) -> BigU { loop {} }
// CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS:.*]], %TsBigU* [[BIGU_ARG_ATTRS1]] byval(%TsBigU) [[BIGU_ARG_ATTRS2]])
// CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS1:.*]] sret(%TsBigU) [[BIGU_RET_ATTRS2:.*]], %TsBigU* [[BIGU_ARG_ATTRS1]] byval(%TsBigU) [[BIGU_ARG_ATTRS2]])
#[no_mangle]
pub extern "C" fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
// CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS]], %TuBigU* [[BIGU_ARG_ATTRS1]] byval(%TuBigU) [[BIGU_ARG_ATTRS2]])
// CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2:.*]], %TuBigU* [[BIGU_ARG_ATTRS1]] byval(%TuBigU) [[BIGU_ARG_ATTRS2]])
#[no_mangle]
pub extern "C" fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
// CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS]], %"TeBigU::Variant"* [[BIGU_ARG_ATTRS1]] byval(%"TeBigU::Variant") [[BIGU_ARG_ATTRS2]])
// CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2:.*]], %"TeBigU::Variant"* [[BIGU_ARG_ATTRS1]] byval(%"TeBigU::Variant") [[BIGU_ARG_ATTRS2]])
#[no_mangle]
pub extern "C" fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }

View file

@ -1,5 +1,7 @@
// compile-flags: -C no-prepopulate-passes
// ignore-tidy-linelength
// min-system-llvm-version: 12.0
// ignore-aarch64
// ignore-emscripten
// ignore-mips64
@ -36,19 +38,19 @@ pub enum TeBigS {
Variant(BigS),
}
// CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS:.*]], [16 x i32]
// CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], [16 x i32]
#[no_mangle]
pub extern fn test_BigS(_: BigS) -> BigS { loop {} }
// CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS]], [16 x i32]
// CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], [16 x i32]
#[no_mangle]
pub extern fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
// CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS]], [16 x i32]
// CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], [16 x i32]
#[no_mangle]
pub extern fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
// CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS]], [16 x i32]
// CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], [16 x i32]
#[no_mangle]
pub extern fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
@ -72,18 +74,18 @@ pub enum TeBigU {
Variant(BigU),
}
// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], [16 x i32]
// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], [16 x i32]
#[no_mangle]
pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
// CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS:.*]], [16 x i32]
// CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS1]] sret(%TsBigU) [[BIGU_RET_ATTRS2]], [16 x i32]
#[no_mangle]
pub extern fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
// CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS]], [16 x i32]
// CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2]], [16 x i32]
#[no_mangle]
pub extern fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
// CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS]], [16 x i32]
// CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2]], [16 x i32]
#[no_mangle]
pub extern fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }

View file

@ -1,5 +1,7 @@
// compile-flags: -C no-prepopulate-passes
// ignore-tidy-linelength
// min-system-llvm-version: 12.0
// only-mips64
// See repr-transparent.rs
@ -25,19 +27,19 @@ pub enum TeBigS {
Variant(BigS),
}
// CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS:.*]], [8 x i64]
// CHECK: define void @test_BigS(%BigS* [[BIGS_RET_ATTRS1:.*]] sret(%BigS) [[BIGS_RET_ATTRS2:.*]], [8 x i64]
#[no_mangle]
pub extern fn test_BigS(_: BigS) -> BigS { loop {} }
// CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS]], [8 x i64]
// CHECK: define void @test_TsBigS(%TsBigS* [[BIGS_RET_ATTRS1]] sret(%TsBigS) [[BIGS_RET_ATTRS2]], [8 x i64]
#[no_mangle]
pub extern fn test_TsBigS(_: TsBigS) -> TsBigS { loop {} }
// CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS]], [8 x i64]
// CHECK: define void @test_TuBigS(%TuBigS* [[BIGS_RET_ATTRS1]] sret(%TuBigS) [[BIGS_RET_ATTRS2]], [8 x i64]
#[no_mangle]
pub extern fn test_TuBigS(_: TuBigS) -> TuBigS { loop {} }
// CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS]], [8 x i64]
// CHECK: define void @test_TeBigS(%"TeBigS::Variant"* [[BIGS_RET_ATTRS1]] sret(%"TeBigS::Variant") [[BIGS_RET_ATTRS2]], [8 x i64]
#[no_mangle]
pub extern fn test_TeBigS(_: TeBigS) -> TeBigS { loop {} }
@ -61,18 +63,18 @@ pub enum TeBigU {
Variant(BigU),
}
// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS:.*]], [8 x i64]
// CHECK: define void @test_BigU(%BigU* [[BIGU_RET_ATTRS1:.*]] sret(%BigU) [[BIGU_RET_ATTRS2:.*]], [8 x i64]
#[no_mangle]
pub extern fn test_BigU(_: BigU) -> BigU { loop {} }
// CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS:.*]], [8 x i64]
// CHECK: define void @test_TsBigU(%TsBigU* [[BIGU_RET_ATTRS1]] sret(%TsBigU) [[BIGU_RET_ATTRS2]], [8 x i64]
#[no_mangle]
pub extern fn test_TsBigU(_: TsBigU) -> TsBigU { loop {} }
// CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS]], [8 x i64]
// CHECK: define void @test_TuBigU(%TuBigU* [[BIGU_RET_ATTRS1]] sret(%TuBigU) [[BIGU_RET_ATTRS2]], [8 x i64]
#[no_mangle]
pub extern fn test_TuBigU(_: TuBigU) -> TuBigU { loop {} }
// CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS]], [8 x i64]
// CHECK: define void @test_TeBigU(%"TeBigU::Variant"* [[BIGU_RET_ATTRS1]] sret(%"TeBigU::Variant") [[BIGU_RET_ATTRS2]], [8 x i64]
#[no_mangle]
pub extern fn test_TeBigU(_: TeBigU) -> TeBigU { loop {} }

View file

@ -12,12 +12,11 @@
# `else` branch. Accordingly, we expect the function that is never called to
# be marked as cold.
#
# The program is compiled with `-Copt-level=s` because this setting disables
# LLVM's pre-inlining pass (i.e. a pass that does some inlining before it adds
# the profiling instrumentation). Disabling this pass leads to rather
# predictable IR which we need for this test to be stable.
# Disable the pre-inlining pass (i.e. a pass that does some inlining before
# it adds the profiling instrumentation). Disabling this pass leads to
# rather predictable IR which we need for this test to be stable.
COMMON_FLAGS=-Copt-level=s -Ccodegen-units=1
COMMON_FLAGS=-Copt-level=2 -Ccodegen-units=1 -Cllvm-args=-disable-preinline
# LLVM doesn't support instrumenting binaries that use SEH:
# https://github.com/rust-lang/rust/issues/61002

View file

@ -4,6 +4,6 @@
# min-llvm-version: 11.0
all:
$(RUSTC) -Z unstable-options -C split-debuginfo=packed foo.rs -g
$(RUSTC) -Z unstable-options -C split-debuginfo=packed -C debuginfo=2 foo.rs -g
rm $(TMPDIR)/foo.dwp
rm $(TMPDIR)/$(call BIN,foo)