about summary refs log tree commit diff
path: root/src/test/codegen/scalar-pair-bool.rs
diff options
context:
space:
mode:
authorJosh Stone <jistone@redhat.com>2018-07-05 14:22:09 -0700
committerJosh Stone <jistone@redhat.com>2018-07-05 14:22:09 -0700
commit557736befc84fb72066128a8c42efe6e4e63a3b1 (patch)
tree1c1b1f3db4dc7a53a04bcca1e42c745f321fc56a /src/test/codegen/scalar-pair-bool.rs
parente5789765606baebd983bd9b1c870cb8b57a0627b (diff)
downloadrust-557736befc84fb72066128a8c42efe6e4e63a3b1.tar.gz
rust-557736befc84fb72066128a8c42efe6e4e63a3b1.zip
Update scalar pairs per review comments
Diffstat (limited to 'src/test/codegen/scalar-pair-bool.rs')
-rw-r--r--src/test/codegen/scalar-pair-bool.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/codegen/scalar-pair-bool.rs b/src/test/codegen/scalar-pair-bool.rs
index 2078a245085..f50e032f8e6 100644
--- a/src/test/codegen/scalar-pair-bool.rs
+++ b/src/test/codegen/scalar-pair-bool.rs
@@ -38,3 +38,17 @@ pub fn pair_and_or((a, b): (bool, bool)) -> (bool, bool) {
     // CHECK: or i1 %arg0.0, %arg0.1
     (a && b, a || b)
 }
+
+// CHECK: define void @pair_branches(i1 zeroext %arg0.0, i1 zeroext %arg0.1)
+#[no_mangle]
+pub fn pair_branches((a, b): (bool, bool)) {
+    // Make sure it can branch directly on the unpacked bool args
+    // CHECK: br i1 %arg0.0
+    if a {
+        println!("Hello!");
+    }
+    // CHECK: br i1 %arg0.1
+    if b {
+        println!("Goodbye!");
+    }
+}