From abefed6f970a4dd6161ce8306399207a624d6a26 Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Mon, 13 Jun 2022 14:34:47 +0200 Subject: [PATCH] [SimplifyCFG] Add test for PR49839 (NFC) --- .../ConditionalTrappingConstantExpr.ll | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/llvm/test/Transforms/SimplifyCFG/ConditionalTrappingConstantExpr.ll b/llvm/test/Transforms/SimplifyCFG/ConditionalTrappingConstantExpr.ll index dad877f98c91..6d827ef9ccc4 100644 --- a/llvm/test/Transforms/SimplifyCFG/ConditionalTrappingConstantExpr.ll +++ b/llvm/test/Transforms/SimplifyCFG/ConditionalTrappingConstantExpr.ll @@ -66,3 +66,22 @@ bb9: bb10: ret i32 927 } + +@g = external global i32 + +define <1 x i64> @trapping_const_agg(i1 %c) { +; CHECK-LABEL: @trapping_const_agg( +; CHECK-NEXT: entry: +; CHECK-NEXT: [[SPEC_SELECT:%.*]] = select i1 [[C:%.*]], <1 x i64> , <1 x i64> zeroinitializer +; CHECK-NEXT: ret <1 x i64> [[SPEC_SELECT]] +; +entry: + br i1 %c, label %if, label %end + +if: + br label %end + +end: + %phi = phi <1 x i64> [ zeroinitializer, %entry ], [ , %if ] + ret <1 x i64> %phi +}