Files
revng-revng/tests/unit/mlir_lit_tests/expressions/pointer-arithmetic.mlir
Lauri Vasama be8351a17d Split up Clift PrimitiveType
* PrimitiveType is now an interface.
* VoidKind is now VoidType.
* FloatKind is now FloatType.
* The integer kinds are now IntegerType with IntegerKind.
2026-04-08 12:18:10 +03:00

18 lines
485 B
MLIR

//
// This file is distributed under the MIT License. See LICENSE.md for details.
//
// RUN: %revngcliftopt %s
!int32_t = !clift.int<signed 4>
!int32_t$ptr = !clift.ptr<8 to !int32_t>
!ptrdiff_t = !clift.int<signed 8>
%p = clift.undef : !int32_t$ptr
%i = clift.imm 0 : !ptrdiff_t
clift.ptr_add %p, %i : (!int32_t$ptr, !ptrdiff_t)
clift.ptr_add %i, %p : (!ptrdiff_t, !int32_t$ptr)
clift.ptr_sub %p, %i : (!int32_t$ptr, !ptrdiff_t)
clift.ptr_diff %p, %p : !int32_t$ptr -> !ptrdiff_t