aboutsummaryrefslogtreecommitdiff
path: root/clang/test/CIR/CodeGen/binop.c
blob: 280fd29b067f932c7ab0afd1dc0e475842d3b802 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir
// RUN: FileCheck --input-file=%t.cir %s

void conditionalResultIimplicitCast(int a, int b, float f) {
  // Should implicit cast back to int.
  int x = a && b;
  // CHECK: %[[#INT:]] = cir.ternary
  // CHECK: %{{.+}} = cir.cast(bool_to_int, %[[#INT]] : !cir.bool), !s32i
  float y = f && f;
  // CHECK: %[[#BOOL:]] = cir.ternary
  // CHECK: %[[#INT:]] = cir.cast(bool_to_int, %[[#BOOL]] : !cir.bool), !s32i
  // CHECK: %{{.+}} = cir.cast(int_to_float, %[[#INT]] : !s32i), !cir.float
}