summaryrefslogtreecommitdiffstats
path: root/tests/codegen/issues/issue-101082.rs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/codegen/issues/issue-101082.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/codegen/issues/issue-101082.rs b/tests/codegen/issues/issue-101082.rs
new file mode 100644
index 000000000..2cbe99942
--- /dev/null
+++ b/tests/codegen/issues/issue-101082.rs
@@ -0,0 +1,17 @@
+// compile-flags: -O
+// min-llvm-version: 16
+// ignore-debug: the debug assertions get in the way
+
+#![crate_type = "lib"]
+
+#[no_mangle]
+pub fn test() -> usize {
+ // CHECK-LABEL: @test(
+ // CHECK: ret {{i64|i32}} 165
+ let values = [23, 16, 54, 3, 60, 9];
+ let mut acc = 0;
+ for item in values {
+ acc += item;
+ }
+ acc
+}