brintos

brintos / llvm-project-archived public Read only

0
0
Text · 570 B · 4427e4b Raw
14 lines · c
1// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir2// RUN: FileCheck --input-file=%t.cir %s3 4void conditionalResultIimplicitCast(int a, int b, float f) {5  // Should implicit cast back to int.6  int x = a && b;7  // CHECK: %[[#INT:]] = cir.ternary8  // CHECK: %{{.+}} = cir.cast bool_to_int %[[#INT]] : !cir.bool -> !s32i9  float y = f && f;10  // CHECK: %[[#BOOL:]] = cir.ternary11  // CHECK: %[[#INT:]] = cir.cast bool_to_int %[[#BOOL]] : !cir.bool -> !s32i12  // CHECK: %{{.+}} = cir.cast int_to_float %[[#INT]] : !s32i -> !cir.float13}14