; Test that pure functions are cse'd away

; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine -adce| llvm-dis | not grep call

int %pure(int %X) {
	%Y = add int %X, 1
	ret int %Y
}

int %test(int %X) {
	%A = call int %pure(int %X)
	%B = call int %pure(int %X)
	%C = sub int %A, %B
	ret int %C
}

; Test that pure functions are cse'd away

; RUN: llvm-as < %s | opt -globalsmodref-aa -load-vn -gcse -instcombine | llvm-dis | not grep sub

int %pure(int %X) {
	%Y = add int %X, 1
	ret int %Y
}

int %test(int %X) {
	%A = call int %pure(int %X)
	%B = call int %pure(int %X)
	%C = sub int %A, %B
	ret int %C
}

Change the test to check to see that CSE happens not dead call elim
Change the test to check to see that CSE happens not dead call elim


git-svn-id: 0ff597fd157e6f4fc38580e8d64ab130330d2411@19017 91177308-0d34-0410-b5e6-96231b3b80d8
