Files
c3c/test/test_suite/distinct/test_ops_on_int.c3
Christoffer Lerno e299a4b630 - Change typedef and const enums to not convert from literals by default. (#2934)
- Add `@constinit` to allow old typedef behaviour.
2026-02-13 20:39:47 +01:00

30 lines
453 B
Plaintext

module test;
typedef Foo @constinit = int;
fn int test1()
{
Foo x = 1;
x += 2;
Foo y = 3;
y = x + y;
int z = 4;
y += (Foo)(z);
y = y << z;
y = y >> z;
y = y + y;
y = y - y;
y = y * y;
y = y / y;
y = y & y;
y = y ^ y;
y = y | y;
bool a1 = y != y;
bool a2 = y < y;
bool a3 = y <= y;
bool a4 = y == y;
y = y == 1 ? 1 : y;
y = y < (y + 1) ? 1 : y;
return (int)(y);
}