Skip to content

Commit

Permalink
tests/codegen: use -Copt-level=3 instead of -O
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Feb 9, 2025
1 parent 5a0032c commit ba88cad
Show file tree
Hide file tree
Showing 233 changed files with 233 additions and 233 deletions.
2 changes: 1 addition & 1 deletion tests/codegen/abi-repr-ext.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

//@ revisions:x86_64 i686 aarch64-apple aarch64-windows aarch64-linux arm riscv

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/align-offset.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/alloc-optimisation.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]

#[no_mangle]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/array-clone.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/array-codegen.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -C no-prepopulate-passes
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/array-equality.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -Z merge-functions=disabled
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled
//@ only-x86_64
#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/array-optimized.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/array-repeat.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]
#![feature(array_repeat)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/asm/goto.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ only-x86_64

#![crate_type = "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/asm/may_unwind.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ only-x86_64

#![crate_type = "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/asm/maybe-uninit.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ only-x86_64

#![crate_type = "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/asm/multiple-options.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ only-x86_64

#![crate_type = "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/asm/options.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ only-x86_64

#![crate_type = "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/asm/x86-clobber_abi.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ only-x86_64

#![crate_type = "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/asm/x86-clobbers.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ only-x86_64

#![crate_type = "rlib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/atomic-operations.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Code generation of atomic operations.
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]

use std::sync::atomic::AtomicI32;
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/atomicptr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
// ensures that we do not have such a round-trip for AtomicPtr::swap, because LLVM supports pointer
// arguments to `atomicrmw xchg`.

//@ compile-flags: -O -Cno-prepopulate-passes
//@ compile-flags: -Copt-level=3 -Cno-prepopulate-passes
#![crate_type = "lib"]
#![feature(strict_provenance_atomic_ptr)]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/avr/avr-func-addrspace.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O --target=avr-unknown-gnu-atmega328 --crate-type=rlib -C panic=abort
//@ compile-flags: -Copt-level=3 --target=avr-unknown-gnu-atmega328 --crate-type=rlib -C panic=abort
//@ needs-llvm-components: avr

// This test validates that function pointers can be stored in global variables
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/binary-heap-peek-mut-pop-no-panic.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ ignore-std-debug-assertions
#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/binary-search-index-no-bound-check.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]

// Make sure no bounds checks are emitted when slicing or indexing
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/box-uninit-bytes.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]

use std::mem::MaybeUninit;
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/call-metadata.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Checks that range metadata gets emitted on calls to functions returning a
// scalar value.

//@ compile-flags: -O -C no-prepopulate-passes
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
//@ max-llvm-major-version: 18

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cast-optimized.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -Z merge-functions=disabled
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled
#![crate_type = "lib"]

// This tests that LLVM can optimize based on the niches in the source or
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cast-target-abi.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// ignore-tidy-linelength
//@ revisions:aarch64 loongarch64 powerpc64 sparc64 x86_64
//@ min-llvm-version: 19
//@ compile-flags: -O -Cno-prepopulate-passes -Zlint-llvm-ir -Cllvm-args=-lint-abort-on-error
//@ compile-flags: -Copt-level=3 -Cno-prepopulate-passes -Zlint-llvm-ir -Cllvm-args=-lint-abort-on-error

//@[aarch64] compile-flags: --target aarch64-unknown-linux-gnu
//@[aarch64] needs-llvm-components: arm
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/catch-unwind.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

// On x86 the closure is inlined in foo() producing something like
// define i32 @foo() [...] {
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/char-ascii-branchless.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Checks that these functions are branchless.
//
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/checked_ilog.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/checked_math.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -Z merge-functions=disabled
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled

#![crate_type = "lib"]
#![feature(unchecked_shifts)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/clone_as_copy.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//@ revisions: DEBUGINFO NODEBUGINFO
//@ compile-flags: -Zunsound-mir-opts
// FIXME: see <https://github.com/rust-lang/rust/issues/132353>
//@ compile-flags: -O -Cno-prepopulate-passes
//@ compile-flags: -Copt-level=3 -Cno-prepopulate-passes
//@ [DEBUGINFO] compile-flags: -Cdebuginfo=full

// From https://github.com/rust-lang/rust/issues/128081.
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/common_prim_int_ptr.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]
#![feature(core_intrinsics)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/const-array.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cross-crate-inlining/always-inline.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ aux-build:always.rs

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cross-crate-inlining/auxiliary/always.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -Zcross-crate-inline-threshold=always
//@ compile-flags: -Copt-level=3 -Zcross-crate-inline-threshold=always

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cross-crate-inlining/auxiliary/leaf.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cross-crate-inlining/auxiliary/never.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -Zcross-crate-inline-threshold=never
//@ compile-flags: -Copt-level=3 -Zcross-crate-inline-threshold=never

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cross-crate-inlining/leaf-inlining.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -Zcross-crate-inline-threshold=yes
//@ compile-flags: -Copt-level=3 -Zcross-crate-inline-threshold=yes
//@ aux-build:leaf.rs

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/cross-crate-inlining/never-inline.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ aux-build:never.rs

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/dealloc-no-unwind.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/debug-fndef-size.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Verify that `i32::cmp` FnDef type is declared with a size of 0 and an
// alignment of 8 bits (1 byte) in LLVM debuginfo.

//@ compile-flags: -O -g -Cno-prepopulate-passes
//@ compile-flags: -Copt-level=3 -g -Cno-prepopulate-passes
//@ ignore-msvc the types are mangled differently

use std::cmp::Ordering;
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/debuginfo-constant-locals.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -g -O
//@ compile-flags: -g -Copt-level=3

// Check that simple constant values are preserved in debuginfo across both MIR opts and LLVM opts

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/debuginfo-inline-callsite-location.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -g -O -C panic=abort
//@ compile-flags: -g -Copt-level=3 -C panic=abort

// Check that each inline call site for the same function uses the same "sub-program" so that LLVM
// can correctly merge the debug info if it merges the inlined code (e.g., for merging of tail
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/deduced-param-attrs.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]
#![allow(incomplete_features)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/drop-in-place-noalias.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -C no-prepopulate-passes
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes

// Tests that the compiler can apply `noalias` and other &mut attributes to `drop_in_place`.
// Note that non-Unpin types should not get `noalias`, matching &mut behavior.
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/dst-vtable-align-nonzero.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -Z merge-functions=disabled
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled

#![crate_type = "lib"]
#![feature(core_intrinsics)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/dst-vtable-size-range.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -Z merge-functions=disabled
//@ compile-flags: -Copt-level=3 -Z merge-functions=disabled

#![crate_type = "lib"]
#![feature(core_intrinsics)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/emscripten-catch-unwind-js-eh.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O --target wasm32-unknown-emscripten
//@ compile-flags: -Copt-level=3 --target wasm32-unknown-emscripten
//@ needs-llvm-components: webassembly

// Emscripten has its own unique implementation of catch_unwind (in `codegen_emcc_try`),
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/emscripten-catch-unwind-wasm-eh.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O --target wasm32-unknown-emscripten -Z emscripten-wasm-eh
//@ compile-flags: -Copt-level=3 --target wasm32-unknown-emscripten -Z emscripten-wasm-eh
//@ needs-llvm-components: webassembly

// Emscripten catch_unwind using wasm exceptions
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/enum/enum-bounds-check-derived-idx.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This test checks an optimization that is not guaranteed to work. This test case should not block
// a future LLVM update.
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/enum/enum-bounds-check-issue-13926.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// This test checks an optimization that is not guaranteed to work. This test case should not block
// a future LLVM update.
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/enum/enum-bounds-check.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/enum/enum-early-otherwise-branch.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/enum/unreachable_enum_default_branch.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3

#![crate_type = "lib"]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/error-provide.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Codegen test for #126242

//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]
#![feature(error_generic_member_access)]
use std::error::Request;
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/external-no-mangle-statics.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//@ revisions: lib staticlib
//@ ignore-emscripten default visibility is hidden
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
//@ [lib] compile-flags: --crate-type lib
//@ [staticlib] compile-flags: --crate-type staticlib
// `#[no_mangle]`d static variables always have external linkage, i.e., no `internal` in their
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/f128-wasm32-callconv.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//! Verify that Rust implements the expected calling convention for `f128`

//@ add-core-stubs
//@ compile-flags: -O --target wasm32-wasip1
//@ compile-flags: -Copt-level=3 --target wasm32-wasip1
//@ needs-llvm-components: webassembly

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/fastcall-inreg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// as "inreg" like the C/C++ compilers for the platforms.
// x86 only.

//@ compile-flags: --target i686-unknown-linux-gnu -O -C no-prepopulate-passes
//@ compile-flags: --target i686-unknown-linux-gnu -Cno-prepopulate-passes -Copt-level=3
//@ needs-llvm-components: x86

#![crate_type = "lib"]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/fewer-names.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -Coverflow-checks=no -O
//@ compile-flags: -Coverflow-checks=no -Copt-level=3
//@ revisions: YES NO
//@ [YES]compile-flags: -Zfewer-names=yes
//@ [NO] compile-flags: -Zfewer-names=no
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/function-arguments.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O -C no-prepopulate-passes
//@ compile-flags: -Copt-level=3 -C no-prepopulate-passes
#![crate_type = "lib"]
#![feature(rustc_attrs)]
#![feature(dyn_star)]
Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/hint/cold_path.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]
#![feature(cold_path)]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/hint/likely.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]
#![feature(likely_unlikely)]

Expand Down
2 changes: 1 addition & 1 deletion tests/codegen/hint/unlikely.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//@ compile-flags: -O
//@ compile-flags: -Copt-level=3
#![crate_type = "lib"]
#![feature(likely_unlikely)]

Expand Down
Loading

0 comments on commit ba88cad

Please sign in to comment.