Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.

Commit cff1a40

Browse files
authored
Unrolled build for rust-lang#136758
Rollup merge of rust-lang#136758 - workingjubilee:specify-opt-level-for-tests, r=saethlin tests: `-Copt-level=3` instead of `-O` in assembly tests An effective blocker for redefining the meaning of `-O` is to stop reusing this somewhat ambiguous alias in our own assembly test suite. The choice between `-Copt-level=2` and `-Copt-level=3` is arbitrary for most of our tests. In most cases it makes no difference, so I set most of them to `-Copt-level=3`, as it will lead to slightly more "normalized" assembly.
2 parents ced8e65 + 833f070 commit cff1a40

27 files changed

+83
-67
lines changed

tests/assembly/asm/aarch64-modifiers.rs

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 2 additions & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

0 commit comments

Comments
 (0)