From f6d12ec45cc973d3b9aaa3d82cb45b4ded165cec Mon Sep 17 00:00:00 2001 From: Robert Konicar Date: Wed, 4 Sep 2024 11:35:33 +0200 Subject: [PATCH] test: Expand choose expr test. --- test/vast/Dialect/HighLevel/choose-expr-a.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/test/vast/Dialect/HighLevel/choose-expr-a.c b/test/vast/Dialect/HighLevel/choose-expr-a.c index 15536b9d3d..0f3c36ebe3 100644 --- a/test/vast/Dialect/HighLevel/choose-expr-a.c +++ b/test/vast/Dialect/HighLevel/choose-expr-a.c @@ -9,5 +9,19 @@ void fn() { // CHECK: hl.value.yield {{%.*}} : !hl.lvalue int z = __builtin_choose_expr(0, x, y); // CHECK: hl.choose_expr cond true : !hl.lvalue { - int w = __builtin_choose_expr(1, x, y); + z = __builtin_choose_expr(1, x, y); + + // CHECK: hl.choose_expr cond true : !hl.lvalue { + // CHECK: hl.value.yield {{%.*}} : !hl.lvalue + // CHECK: hl.value.yield {{%.*}} : !hl.void + z = __builtin_choose_expr(1, x, (void) 0); + // CHECK: hl.choose_expr cond false : !hl.lvalue { + // CHECK: hl.value.yield {{%.*}} : !hl.void + // CHECK: hl.value.yield {{%.*}} : !hl.lvalue + z = __builtin_choose_expr(0, (void) 0, x); + + // CHECK: hl.choose_expr cond true : !hl.lvalue { + // CHECK: hl.value.yield {{%.*}} : !hl.lvalue + // CHECK: hl.value.yield {{%.*}} : !hl.char + z = __builtin_choose_expr(1, x, (char) 0); }