aboutsummaryrefslogtreecommitdiff
path: root/tests/conformance/3-expressions/int_sub_wrap.zc
blob: f906dd096d32a3674353c36c245166191051c12b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
// expect: 9223372036854775807/9223372036854775807/-9223372036854775808/-9223372036854775808/-2/-2/
// spec 3.4.1
include rt;
void pn(int x) { rt.put_n(x); rt.put_c(10); }
fn main() {
	pn((-9223372036854775807 - 1) - 1);
	{ int a = (-9223372036854775807 - 1), b = 1; pn(a - b); }
	pn(0 - (-9223372036854775807 - 1));
	{ int a = 0, b = (-9223372036854775807 - 1); pn(a - b); }
	pn(5 - 7);
	{ int a = 5, b = 7; pn(a - b); }
	return 0;
}