Debian Codegraph @

clang/test/CIR/CodeGen/binop.c

raw
1 // RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
2 // RUN: FileCheck --input-file=%t.cir %s
3
4 void conditionalResultIimplicitCast(int a, int b, float f) {
5 // Should implicit cast back to int.
6 int x = a && b;
7 // CHECK: %[[#INT:]] = cir.ternary
8 // CHECK: %{{.+}} = cir.cast bool_to_int %[[#INT]] : !cir.bool -> !s32i
9 float y = f && f;
10 // CHECK: %[[#BOOL:]] = cir.ternary
11 // CHECK: %[[#INT:]] = cir.cast bool_to_int %[[#BOOL]] : !cir.bool -> !s32i
12 // CHECK: %{{.+}} = cir.cast int_to_float %[[#INT]] : !s32i -> !cir.float
13 }