diff --git a/llvm/test/Regression/Analysis/BasicAA/tailcall-modref.ll b/llvm/test/Regression/Analysis/BasicAA/tailcall-modref.ll new file mode 100644 index 000000000000..c58ad7ffcd4c --- /dev/null +++ b/llvm/test/Regression/Analysis/BasicAA/tailcall-modref.ll @@ -0,0 +1,16 @@ +; RUN: llvm-as < %s | opt -basicaa -load-vn -gcse -instcombine | llvm-dis | grep 'ret int 0' +declare void %foo(int*) +declare void %bar() + +int %test() { + %A = alloca int + call void %foo(int* %A) + + %X = load int* %A + tail call void %bar() ;; Cannot modify *%A because it's on the stack. + %Y = load int* %A + %Z = sub int %X, %Y + ret int %Z +} + +