blob: 21c86b774c5afa8c1df943f3243af6cc4a36ee31 [file] [log] [blame]
Owen Anderson7c856c02008-08-16 00:00:54 +00001; RUN: llvm-as < %s | opt -basicaa -gvn -instcombine |\
Tanya Lattnerdcd188d2008-02-14 06:56:27 +00002; RUN: llvm-dis | grep {load i32\\* %A}
Chris Lattner465e24b2005-03-09 16:29:22 +00003
Tanya Lattnerdcd188d2008-02-14 06:56:27 +00004declare double* @useit(i32*)
Chris Lattner465e24b2005-03-09 16:29:22 +00005
Tanya Lattnerdcd188d2008-02-14 06:56:27 +00006define i32 @foo(i32 %Amt) {
7 %A = malloc i32, i32 %Amt
8 %P = call double* @useit(i32* %A)
Chris Lattner465e24b2005-03-09 16:29:22 +00009
Tanya Lattnerdcd188d2008-02-14 06:56:27 +000010 %X = load i32* %A
Chris Lattner465e24b2005-03-09 16:29:22 +000011 store double 0.0, double* %P
Tanya Lattnerdcd188d2008-02-14 06:56:27 +000012 %Y = load i32* %A
13 %Z = sub i32 %X, %Y
14 ret i32 %Z
Chris Lattner465e24b2005-03-09 16:29:22 +000015}