module test;

fn void tester()
{
    int *x;
    short y = (short)((uptr)(x));
    uptr z = (uptr)((short)((uptr)(x)));
}

/* #expect: test.ll

  %x = alloca ptr, align 8
  %y = alloca i16, align 2
  %z = alloca i64, align 8
  store ptr null, ptr %x, align 8
  %0 = load ptr, ptr %x, align 8
  %ptrxi = ptrtoint ptr %0 to i16
  store i16 %ptrxi, ptr %y, align 2
  %1 = load ptr, ptr %x, align 8
  %ptrxi1 = ptrtoint ptr %1 to i16
  %sext = sext i16 %ptrxi1 to i64
  store i64 %sext, ptr %z, align 8
