aboutsummaryrefslogtreecommitdiffstats
path: root/test/Transforms/Reassociate/subtest.ll
blob: e3a7adf5aed7f8caf35d010f275cf6b2f7f7f4bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
; With sub reassociation, constant folding can eliminate the 12 and -12 constants.
;
; RUN: if as < %s | opt -reassociate -constprop -instcombine -die | dis | grep 12
; RUN: then exit 1
; RUN: else exit 0
; RUN: fi

int "test"(int %A, int %B) {
	%X = add int -12, %A
	%Y = sub int %X, %B
	%Z = add int %Y, 12
	ret int %Z
}