diff options
author | Chris Lattner <sabre@nondot.org> | 2008-04-19 22:32:52 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2008-04-19 22:32:52 +0000 |
commit | cbb94f14067f574e835d25b0492e569b0bb9103a (patch) | |
tree | c6eb6b32b7cc36629c9abb53e6974aafe6dbf32f /test/Transforms/GlobalOpt/storepointer-compare.ll | |
parent | 9dfeffd4a5090df1f9c344a7c5e2f2265184acee (diff) | |
download | external_llvm-cbb94f14067f574e835d25b0492e569b0bb9103a.zip external_llvm-cbb94f14067f574e835d25b0492e569b0bb9103a.tar.gz external_llvm-cbb94f14067f574e835d25b0492e569b0bb9103a.tar.bz2 |
rename *.llx -> *.ll, last batch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49971 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Transforms/GlobalOpt/storepointer-compare.ll')
-rw-r--r-- | test/Transforms/GlobalOpt/storepointer-compare.ll | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/Transforms/GlobalOpt/storepointer-compare.ll b/test/Transforms/GlobalOpt/storepointer-compare.ll new file mode 100644 index 0000000..86eff51 --- /dev/null +++ b/test/Transforms/GlobalOpt/storepointer-compare.ll @@ -0,0 +1,30 @@ +; RUN: llvm-as < %s | opt -globalopt | llvm-dis | \ +; RUN: grep {call void @Actual} + +; Check that a comparison does not prevent an indirect call from being made +; direct. The global will still remain, but indirect call elim is still good. + +@G = internal global void ()* null ; <void ()**> [#uses=2] + +define internal void @Actual() { + ret void +} + +define void @init() { + store void ()* @Actual, void ()** @G + ret void +} + +define void @doit() { + %FP = load void ()** @G ; <void ()*> [#uses=2] + %CC = icmp eq void ()* %FP, null ; <i1> [#uses=1] + br i1 %CC, label %isNull, label %DoCall + +DoCall: ; preds = %0 + call void %FP( ) + ret void + +isNull: ; preds = %0 + ret void +} + |