about summary refs log tree commit diff
path: root/tests/codegen
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-05-26 14:53:24 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2023-05-26 15:00:31 +0000
commit5f66c4192111e4fda5ccbdb714e97e18ac6adcc4 (patch)
treee408276b89586daffecd9ad82bf416969517457c /tests/codegen
parenteb9da7bfa375ad58bcb946115f3191a2756785e5 (diff)
downloadrust-5f66c4192111e4fda5ccbdb714e97e18ac6adcc4.tar.gz
rust-5f66c4192111e4fda5ccbdb714e97e18ac6adcc4.zip
Add regression test
Diffstat (limited to 'tests/codegen')
-rw-r--r--tests/codegen/const_scalar_pair.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/codegen/const_scalar_pair.rs b/tests/codegen/const_scalar_pair.rs
new file mode 100644
index 00000000000..16e6484585c
--- /dev/null
+++ b/tests/codegen/const_scalar_pair.rs
@@ -0,0 +1,10 @@
+// compile-flags: --crate-type=lib -Copt-level=0 -Zmir-opt-level=0 -C debuginfo=2
+
+// CHECK: @0 = private unnamed_addr constant <{ [8 x i8] }> <{ [8 x i8] c"\01\00\00\00\02\00\00\00" }>, align 4
+
+#![feature(inline_const)]
+
+pub fn foo() -> (i32, i32) {
+    // CHECK: %0 = load i32, ptr @0, align 4
+    const { (1, 2) }
+}