Files
2025-03-24 09:27:57 +02:00

43 lines
1.4 KiB
MLIR

//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
// RUN: %revngcliftopt %s --emit-c="tagless model=%S/model.yml" -o /dev/null | FileCheck %s
!void = !clift.primitive<void 0>
!f = !clift.defined<#clift.func<
"/type-definition/1001-CABIFunctionDefinition" : !void()
>>
!int32_t = !clift.primitive<signed 4>
!int32_t$const = !clift.primitive<const signed 4>
!int32_t$const$ptr = !clift.ptr<8 to !int32_t$const>
!int32_t$const$ptr$const = !clift.ptr<const 8 to !int32_t$const>
!int32_t$const$ptr$const$ptr = !clift.ptr<8 to !int32_t$const$ptr$const>
!int32_t$const$ptr$const$ptr$const = !clift.ptr<const 8 to !int32_t$const$ptr$const>
clift.module {
// CHECK: void fun_0x40001001(void) {
clift.func @f<!f>() attributes {
handle = "/function/0x40001001:Code_x86_64"
} {
// CHECK: const int32_t _var_0 = 0;
%x = clift.local !int32_t$const "x" = {
%0 = clift.imm 0 : !int32_t
clift.yield %0 : !int32_t
}
// CHECK: const int32_t *const _var_1 = &_var_0;
%p = clift.local !int32_t$const$ptr$const "p" = {
%0 = clift.addressof %x : !int32_t$const$ptr
clift.yield %0 : !int32_t$const$ptr
}
// CHECK: const int32_t *const *const _var_2 = &_var_1;
%q = clift.local !int32_t$const$ptr$const$ptr$const "q" = {
%0 = clift.addressof %p : !int32_t$const$ptr$const$ptr
clift.yield %0 : !int32_t$const$ptr$const$ptr
}
}
// CHECK: }
}