about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2025-01-26 14:36:23 +0000
committerGitHub <noreply@github.com>2025-01-26 14:36:23 +0000
commitd7e942eb91111f3db249842ea1866e5bbf405538 (patch)
tree8db5894ece32ab3228cf11299b855c55cc1ce76e /tests/codegen
parent57eabac8351013154cef7bac0f27759094ff5a96 (diff)
parentc688ecf4680b18734690159de7ba1ebf0c7e4026 (diff)
downloadrust-d7e942eb91111f3db249842ea1866e5bbf405538.tar.gz
rust-d7e942eb91111f3db249842ea1866e5bbf405538.zip
Merge pull request #4151 from rust-lang/rustup-2025-01-26
Automatic Rustup
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/optimize-attr-1.rs14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/codegen/optimize-attr-1.rs b/tests/codegen/optimize-attr-1.rs
index 3aee44791e0..db6bdcf9a8b 100644
--- a/tests/codegen/optimize-attr-1.rs
+++ b/tests/codegen/optimize-attr-1.rs
@@ -37,11 +37,23 @@ pub fn speed() -> i32 {
     4 + 4
 }
 
+// CHECK-LABEL: define{{.*}}i32 @none
+// CHECK-SAME: [[NONE_ATTRS:#[0-9]+]]
+// SIZE-OPT: alloca
+// SPEED-OPT: alloca
+#[no_mangle]
+#[optimize(none)]
+pub fn none() -> i32 {
+    let arr = [0, 1, 2, 3, 4];
+    arr[4]
+}
+
 // NO-OPT-DAG: attributes [[SIZE_ATTRS]] = {{.*}}minsize{{.*}}optsize{{.*}}
 // SPEED-OPT-DAG: attributes [[SIZE_ATTRS]] = {{.*}}minsize{{.*}}optsize{{.*}}
 // SIZE-OPT-DAG: attributes [[NOTHING_ATTRS]] = {{.*}}optsize{{.*}}
 // SIZE-OPT-DAG: attributes [[SIZE_ATTRS]] = {{.*}}minsize{{.*}}optsize{{.*}}
+// CHECK-DAG: attributes [[NONE_ATTRS]] = {{.*}}noinline{{.*}}optnone{{.*}}
 
-// SIZE-OPT: attributes [[SPEED_ATTRS]]
+// SIZE-OPT-DAG: attributes [[SPEED_ATTRS]]
 // SIZE-OPT-NOT: minsize
 // SIZE-OPT-NOT: optsize