mirror of
https://github.com/revng/revng
synced 2026-06-21 14:07:57 +00:00
64fc21e9dd
Old syntax: ``` !clift.pointer<pointer_size = 8, pointee_type = !t> !clift.pointer<is_const = true, pointer_size = 8, pointee_type = !t> ``` New syntax: ``` !clift.ptr<8 to !t> !clift.ptr<const 8 to !t> ```
18 lines
497 B
MLIR
18 lines
497 B
MLIR
//
|
|
// This file is distributed under the MIT License. See LICENSE.md for details.
|
|
//
|
|
|
|
// RUN: %revngcliftopt %s
|
|
|
|
!int32_t = !clift.primitive<signed 4>
|
|
!int32_t$ptr = !clift.ptr<8 to !int32_t>
|
|
!ptrdiff_t = !clift.primitive<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
|