Skip to content

Commit c912816

Browse files
committed
Auto merge of rust-lang#136758 - workingjubilee:specify-opt-level-for-tests, r=<try>
tests: Specify `-Copt-level=3` instead of `-O` in tests An effective blocker for rust-lang#135439 r? `@ghost` try-job: test-various try-job: aarch64-gnu try-job: aarch64-gnu-debug try-job: i686-gnu-1 try-job: i686-gnu-2 try-job: i686-mingw try-job: i686-msvc-1 try-job: i686-msvc-2 try-job: x86_64-msvc-1 try-job: x86_64-msvc-2
2 parents 43ca9d1 + ee111b2 commit c912816

27 files changed

+58
-51
lines changed

tests/assembly/asm/aarch64-modifiers.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ add-core-stubs
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: -O -C panic=abort
3+
//@ compile-flags: -Copt-level=3 -C panic=abort
44
//@ compile-flags: --target aarch64-unknown-linux-gnu
55
//@ compile-flags: -Zmerge-functions=disabled
66
//@ needs-llvm-components: aarch64
@@ -15,7 +15,7 @@ use minicore::*;
1515

1616
macro_rules! check {
1717
($func:ident $reg:ident $code:literal) => {
18-
// -O and extern "C" guarantee that the selected register is always r0/s0/d0/q0
18+
// -Copt-level=3 and extern "C" guarantee that the selected register is always r0/s0/d0/q0
1919
#[no_mangle]
2020
pub unsafe extern "C" fn $func() -> i32 {
2121
let y;

tests/assembly/asm/aarch64-outline-atomics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ assembly-output: emit-asm
2-
//@ compile-flags: -O
2+
//@ compile-flags: -Copt-level=3
33
//@ compile-flags: --target aarch64-unknown-linux-gnu
44
//@ needs-llvm-components: aarch64
55
//@ only-aarch64

tests/assembly/asm/arm-modifiers.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ add-core-stubs
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: -O -C panic=abort
3+
//@ compile-flags: -Copt-level=3 -C panic=abort
44
//@ compile-flags: --target armv7-unknown-linux-gnueabihf
55
//@ compile-flags: -C target-feature=+neon
66
//@ compile-flags: -Zmerge-functions=disabled
@@ -21,7 +21,7 @@ impl Copy for f32x4 {}
2121

2222
macro_rules! check {
2323
($func:ident $modifier:literal $reg:ident $ty:ident $mov:literal) => {
24-
// -O and extern "C" guarantee that the selected register is always r0/s0/d0/q0
24+
// -Copt-level=3 and extern "C" guarantee that the selected register is always r0/s0/d0/q0
2525
#[no_mangle]
2626
pub unsafe extern "C" fn $func() -> $ty {
2727
let y;

tests/assembly/asm/x86-modifiers.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ add-core-stubs
22
//@ revisions: x86_64 i686
33
//@ assembly-output: emit-asm
4-
//@ compile-flags: -O -C panic=abort
4+
//@ compile-flags: -Copt-level=3 -C panic=abort
55
//@[x86_64] compile-flags: --target x86_64-unknown-linux-gnu
66
//@[x86_64] needs-llvm-components: x86
77
//@[i686] compile-flags: --target i686-unknown-linux-gnu
@@ -20,7 +20,7 @@ use minicore::*;
2020

2121
macro_rules! check {
2222
($func:ident $modifier:literal $reg:ident $mov:literal) => {
23-
// -O and extern "C" guarantee that the selected register is always ax/xmm0
23+
// -Copt-level=3 and extern "C" guarantee that the selected register is always ax/xmm0
2424
#[no_mangle]
2525
pub unsafe extern "C" fn $func() -> i32 {
2626
let y;

tests/assembly/libs/issue-115339-zip-arrays.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ assembly-output: emit-asm
22
// # zen3 previously exhibited odd vectorization
3-
//@ compile-flags: --crate-type=lib -Ctarget-cpu=znver3 -O
3+
//@ compile-flags: --crate-type=lib -Ctarget-cpu=znver3 -Copt-level=3
44
//@ only-x86_64
55
//@ ignore-sgx
66

tests/assembly/manual-eq-efficient.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Regression test for #106269
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
3+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C llvm-args=-x86-asm-syntax=intel
44
//@ only-x86_64
55
//@ ignore-sgx
66

tests/assembly/panic-no-unwind-no-uwtable.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ assembly-output: emit-asm
22
//@ only-x86_64-unknown-linux-gnu
3-
//@ compile-flags: -C panic=unwind -C force-unwind-tables=n -O
3+
//@ compile-flags: -C panic=unwind -C force-unwind-tables=n -Copt-level=3
44

55
#![crate_type = "lib"]
66

tests/assembly/powerpc64-struct-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ revisions: elfv1-be elfv2-be elfv2-le aix
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: -O
3+
//@ compile-flags: -Copt-level=3
44
//@[elfv1-be] compile-flags: --target powerpc64-unknown-linux-gnu
55
//@[elfv1-be] needs-llvm-components: powerpc
66
//@[elfv2-be] compile-flags: --target powerpc64-unknown-linux-musl

tests/assembly/s390x-backchain-toggle.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ revisions: enable-backchain disable-backchain
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: -O --crate-type=lib --target=s390x-unknown-linux-gnu
3+
//@ compile-flags: -Copt-level=3 --crate-type=lib --target=s390x-unknown-linux-gnu
44
//@ needs-llvm-components: systemz
55
//@[enable-backchain] compile-flags: -Ctarget-feature=+backchain
66
//@[disable-backchain] compile-flags: -Ctarget-feature=-backchain

tests/assembly/s390x-vector-abi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
//@ revisions: z10 z10_vector z13 z13_no_vector
22
// ignore-tidy-linelength
33
//@ assembly-output: emit-asm
4-
//@ compile-flags: -O -Z merge-functions=disabled
4+
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled
55
//@[z10] compile-flags: --target s390x-unknown-linux-gnu --cfg no_vector
66
//@[z10] needs-llvm-components: systemz
77
//@[z10_vector] compile-flags: --target s390x-unknown-linux-gnu -C target-feature=+vector

tests/assembly/simd-bitmask.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
//@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
1111
//@ [aarch64] needs-llvm-components: aarch64
1212
//@ assembly-output: emit-asm
13-
//@ compile-flags: --crate-type=lib -O -C panic=abort
13+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
1414

1515
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1616
#![no_core]

tests/assembly/simd-intrinsic-gather.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
44
//@ [x86-avx512] needs-llvm-components: x86
55
//@ assembly-output: emit-asm
6-
//@ compile-flags: --crate-type=lib -O -C panic=abort
6+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
77

88
#![feature(no_core, lang_items, repr_simd, intrinsics)]
99
#![no_core]

tests/assembly/simd-intrinsic-mask-load.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
77
//@ [x86-avx512] needs-llvm-components: x86
88
//@ assembly-output: emit-asm
9-
//@ compile-flags: --crate-type=lib -O -C panic=abort
9+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
1010

1111
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1212
#![no_core]

tests/assembly/simd-intrinsic-mask-reduce.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
//@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
88
//@ [aarch64] needs-llvm-components: aarch64
99
//@ assembly-output: emit-asm
10-
//@ compile-flags: --crate-type=lib -O -C panic=abort
10+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
1111

1212
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1313
#![no_core]

tests/assembly/simd-intrinsic-mask-store.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
77
//@ [x86-avx512] needs-llvm-components: x86
88
//@ assembly-output: emit-asm
9-
//@ compile-flags: --crate-type=lib -O -C panic=abort
9+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
1010

1111
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1212
#![no_core]

tests/assembly/simd-intrinsic-scatter.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ [x86-avx512] compile-flags: -C target-feature=+avx512f,+avx512vl,+avx512bw,+avx512dq
44
//@ [x86-avx512] needs-llvm-components: x86
55
//@ assembly-output: emit-asm
6-
//@ compile-flags: --crate-type=lib -O -C panic=abort
6+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
77

88
#![feature(no_core, lang_items, repr_simd, intrinsics)]
99
#![no_core]

tests/assembly/simd-intrinsic-select.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//@ [aarch64] compile-flags: --target=aarch64-unknown-linux-gnu
99
//@ [aarch64] needs-llvm-components: aarch64
1010
//@ assembly-output: emit-asm
11-
//@ compile-flags: --crate-type=lib -O -C panic=abort
11+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C panic=abort
1212

1313
#![feature(no_core, lang_items, repr_simd, intrinsics)]
1414
#![no_core]

tests/assembly/simd/reduce-fadd-unordered.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//@ revisions: x86_64 aarch64
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: --crate-type=lib -O
3+
//@ compile-flags: --crate-type=lib -Copt-level=3
4+
45
//@[aarch64] only-aarch64
56
//@[x86_64] only-x86_64
67
//@[x86_64] compile-flags: -Ctarget-feature=+sse3

tests/assembly/slice-is_ascii.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
//@ [WIN] only-windows
33
//@ [LIN] only-linux
44
//@ assembly-output: emit-asm
5-
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
5+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C llvm-args=-x86-asm-syntax=intel
66
//@ only-x86_64
77
//@ ignore-sgx
88

tests/assembly/x86-return-float.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// Use the same target CPU as `i686` so that LLVM orders the instructions in the same order.
77
//@ compile-flags: -Ctarget-feature=+sse2 -Ctarget-cpu=pentium4
88
// Force frame pointers to make ASM more consistent between targets
9-
//@ compile-flags: -O -C force-frame-pointers
9+
//@ compile-flags: -Copt-level=3 -C force-frame-pointers
1010
//@ filecheck-flags: --implicit-check-not fld --implicit-check-not fst
1111
//@ revisions: normal win
1212
//@[normal] ignore-windows

tests/assembly/x86_64-array-pair-load-store-merge.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
//@ assembly-output: emit-asm
2-
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel
2+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C llvm-args=-x86-asm-syntax=intel
33
//@ only-x86_64
44
//@ ignore-sgx
55
//@ ignore-apple (manipulates rsp too)

tests/assembly/x86_64-bigint-helpers.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@ only-x86_64
22
//@ assembly-output: emit-asm
3-
//@ compile-flags: --crate-type=lib -O -C target-cpu=x86-64-v4
3+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C target-cpu=x86-64-v4
44
//@ compile-flags: -C llvm-args=-x86-asm-syntax=intel
55
//@ revisions: llvm-pre-20 llvm-20
66
//@ [llvm-20] min-llvm-version: 20

tests/assembly/x86_64-floating-point-clamp.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//@ assembly-output: emit-asm
55
// Set the base cpu explicitly, in case the default has been changed.
6-
//@ compile-flags: --crate-type=lib -O -C llvm-args=-x86-asm-syntax=intel -C target-cpu=x86-64
6+
//@ compile-flags: --crate-type=lib -Copt-level=3 -C llvm-args=-x86-asm-syntax=intel -C target-cpu=x86-64
77
//@ only-x86_64
88
//@ ignore-sgx
99

tests/assembly/x86_64-function-return.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//@ revisions: unset keep thunk-extern keep-thunk-extern thunk-extern-keep
55
//@ assembly-output: emit-asm
6-
//@ compile-flags: -O
6+
//@ compile-flags: -Copt-level=3
77
//@ [keep] compile-flags: -Zfunction-return=keep
88
//@ [thunk-extern] compile-flags: -Zfunction-return=thunk-extern
99
//@ [keep-thunk-extern] compile-flags: -Zfunction-return=keep -Zfunction-return=thunk-extern

tests/assembly/x86_64-no-jump-tables.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
//@ revisions: unset set
55
//@ assembly-output: emit-asm
6-
//@ compile-flags: -O
6+
//@ compile-flags: -Copt-level=3
77
//@ [set] compile-flags: -Zno-jump-tables
88
//@ only-x86_64
99
//@ ignore-sgx

tests/assembly/x86_64-typed-swap.rs

+20-20
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
//@ [LIN] only-linux
44
//@ only-x86_64
55
//@ assembly-output: emit-asm
6-
//@ compile-flags: --crate-type=lib -O
6+
//@ compile-flags: --crate-type=lib -Copt-level=3
77

88
use std::arch::x86_64::__m128;
99
use std::mem::swap;
@@ -12,42 +12,42 @@ use std::mem::swap;
1212
#[no_mangle]
1313
pub fn swap_i32(x: &mut i32, y: &mut i32) {
1414
// CHECK: movl (%[[ARG1:.+]]), %[[T1:.+]]
15-
// CHECK: movl (%[[ARG2:.+]]), %[[T2:.+]]
16-
// CHECK: movl %[[T2]], (%[[ARG1]])
17-
// CHECK: movl %[[T1]], (%[[ARG2]])
18-
// CHECK: retq
15+
// CHECK-NEXT: movl (%[[ARG2:.+]]), %[[T2:.+]]
16+
// CHECK-DAG: movl %[[T2]], (%[[ARG1]])
17+
// CHECK-DAG: movl %[[T1]], (%[[ARG2]])
18+
// CHECK-NEXT: retq
1919
swap(x, y)
2020
}
2121

2222
// CHECK-LABEL: swap_pair:
2323
#[no_mangle]
2424
pub fn swap_pair(x: &mut (i32, u32), y: &mut (i32, u32)) {
25-
// CHECK: movq (%[[ARG1]]), %[[T1:.+]]
26-
// CHECK: movq (%[[ARG2]]), %[[T2:.+]]
27-
// CHECK: movq %[[T2]], (%[[ARG1]])
28-
// CHECK: movq %[[T1]], (%[[ARG2]])
29-
// CHECK: retq
25+
// CHECK: movq (%[[ARG1:r..?]]), %[[T1:.+]]
26+
// CHECK-NEXT: movq (%[[ARG2:r..?]]), %[[T2:.+]]
27+
// CHECK-DAG: movq %[[T2]], (%[[ARG1]])
28+
// CHECK-DAG: movq %[[T1]], (%[[ARG2]])
29+
// CHECK-NEXT: retq
3030
swap(x, y)
3131
}
3232

3333
// CHECK-LABEL: swap_str:
3434
#[no_mangle]
3535
pub fn swap_str<'a>(x: &mut &'a str, y: &mut &'a str) {
36-
// CHECK: movups (%[[ARG1]]), %[[T1:xmm.]]
37-
// CHECK: movups (%[[ARG2]]), %[[T2:xmm.]]
38-
// CHECK: movups %[[T2]], (%[[ARG1]])
39-
// CHECK: movups %[[T1]], (%[[ARG2]])
40-
// CHECK: retq
36+
// CHECK: movups (%[[ARG1:r..?]]), %[[T1:xmm.]]
37+
// CHECK-NEXT: movups (%[[ARG2:r..?]]), %[[T2:xmm.]]
38+
// CHECK-DAG: movups %[[T2]], (%[[ARG1]])
39+
// CHECK-DAG: movups %[[T1]], (%[[ARG2]])
40+
// CHECK-NEXT: retq
4141
swap(x, y)
4242
}
4343

4444
// CHECK-LABEL: swap_simd:
4545
#[no_mangle]
4646
pub fn swap_simd(x: &mut __m128, y: &mut __m128) {
47-
// CHECK: movaps (%[[ARG1]]), %[[T1:xmm.]]
48-
// CHECK: movaps (%[[ARG2]]), %[[T2:xmm.]]
49-
// CHECK: movaps %[[T2]], (%[[ARG1]])
50-
// CHECK: movaps %[[T1]], (%[[ARG2]])
51-
// CHECK: retq
47+
// CHECK: movaps (%[[ARG1:r..?]]), %[[T1:xmm.]]
48+
// CHECK-NEXT: movaps (%[[ARG2:r..?]]), %[[T2:xmm.]]
49+
// CHECK-DAG: movaps %[[T2]], (%[[ARG1]])
50+
// CHECK-DAG: movaps %[[T1]], (%[[ARG2]])
51+
// CHECK-NEXT: retq
5252
swap(x, y)
5353
}

tests/assembly/x86_64-windows-float-abi.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,17 @@
11
//@ assembly-output: emit-asm
2-
//@ compile-flags: -O
3-
//@ only-windows
4-
//@ only-x86_64
2+
//@ compile-flags: -Copt-level=3
3+
//@ compile-flags: --target x86_64-pc-windows-msvc
4+
//@ needs-llvm-components: x86
5+
//@ add-core-stubs
56

67
#![feature(f16, f128)]
8+
#![feature(no_core)]
9+
#![no_core]
710
#![crate_type = "lib"]
811

12+
extern crate minicore;
13+
use minicore::*;
14+
915
// CHECK-LABEL: second_f16
1016
// CHECK: movaps %xmm1, %xmm0
1117
// CHECK-NEXT: retq

0 commit comments

Comments
 (0)