Debian Codegraph @

clang/test/CIR/IR/cast.cir

raw
1 // RUN: cir-opt %s --verify-roundtrip | FileCheck %s
2 !s32i = !cir.int<s, 32>
3
4 module {
5 cir.func @yolo(%arg0 : !s32i) {
6 %a = cir.cast int_to_bool %arg0 : !s32i -> !cir.bool
7
8 %0 = cir.const #cir.int<0> : !s32i
9 cir.return
10 }
11
12 cir.func @bitcast(%p: !cir.ptr<!s32i>) {
13 %0 = cir.cast bitcast %p : !cir.ptr<!s32i> -> !cir.ptr<f32>
14 cir.return
15 }
16 }
17
18 // CHECK: cir.func{{.*}} @yolo(%arg0: !s32i)
19 // CHECK: %0 = cir.cast int_to_bool %arg0 : !s32i -> !cir.bool
20 // CHECK: %1 = cir.const #cir.int<0> : !s32i
21
22 // CHECK: cir.func{{.*}} @bitcast
23 // CHECK: %0 = cir.cast bitcast %arg0 : !cir.ptr<!s32i> -> !cir.ptr<f32>