From 557736befc84fb72066128a8c42efe6e4e63a3b1 Mon Sep 17 00:00:00 2001 From: Josh Stone Date: Thu, 5 Jul 2018 14:22:09 -0700 Subject: Update scalar pairs per review comments --- src/test/codegen/scalar-pair-bool.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/test/codegen') 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!"); + } +} -- cgit 1.4.1-3-g733a5