about summary refs log tree commit diff
path: root/tests/ui/codegen/const-bool-bitcast.rs
diff options
context:
space:
mode:
authorBen Kimock <kimockb@gmail.com>2023-12-09 15:53:41 -0500
committerBen Kimock <kimockb@gmail.com>2023-12-09 17:13:11 -0500
commitb0a580112b53f3b64abf2d67b6776141d0fa7c44 (patch)
tree6c910c96eda19d6528b8f3c30912c65eb908d54a /tests/ui/codegen/const-bool-bitcast.rs
parent2b399b52753eac351067e73f4ff0de829443b9a7 (diff)
downloadrust-b0a580112b53f3b64abf2d67b6776141d0fa7c44.tar.gz
rust-b0a580112b53f3b64abf2d67b6776141d0fa7c44.zip
Use immediate_backend_type when reading from a const alloc
Diffstat (limited to 'tests/ui/codegen/const-bool-bitcast.rs')
-rw-r--r--tests/ui/codegen/const-bool-bitcast.rs15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/codegen/const-bool-bitcast.rs b/tests/ui/codegen/const-bool-bitcast.rs
new file mode 100644
index 00000000000..24ae76b9029
--- /dev/null
+++ b/tests/ui/codegen/const-bool-bitcast.rs
@@ -0,0 +1,15 @@
+// This is a regression test for https://github.com/rust-lang/rust/issues/118047
+// build-pass
+// compile-flags: -Zmir-opt-level=0 -Zmir-enable-passes=+DataflowConstProp
+
+#![crate_type = "lib"]
+
+pub struct State {
+    inner: bool
+}
+
+pub fn make() -> State {
+    State {
+        inner: true
+    }
+}