[llvm] r210486 - Added functions cross-reference test.

Stepan Dyatkovskiy stpworld at narod.ru
Mon Jun 9 12:03:02 PDT 2014


Author: dyatkovskiy
Date: Mon Jun  9 14:03:02 2014
New Revision: 210486

URL: http://llvm.org/viewvc/llvm-project?rev=210486&view=rev
Log:
Added functions cross-reference test.
Originally this similar was initiated by Björn Steinbrink here:
http://reviews.llvm.org/D3437

Bug itself has been fixed by principal changes in MergeFunctions. Though
special checks for functions merging are still actual. And the test has
been accepted with slight modifications.


Added:
    llvm/trunk/test/Transforms/MergeFunc/functions.ll

Added: llvm/trunk/test/Transforms/MergeFunc/functions.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/Transforms/MergeFunc/functions.ll?rev=210486&view=auto
==============================================================================
--- llvm/trunk/test/Transforms/MergeFunc/functions.ll (added)
+++ llvm/trunk/test/Transforms/MergeFunc/functions.ll Mon Jun  9 14:03:02 2014
@@ -0,0 +1,27 @@
+; RUN: opt -S -mergefunc < %s | FileCheck %s
+
+; Be sure we don't merge cross-referenced functions of same type.
+
+; CHECK-LABEL: @left
+; CHECK-LABEL: entry-block
+; CHECK-LABEL: call void @right(i64 %p)
+define void @left(i64 %p) {
+entry-block:
+  call void @right(i64 %p)
+  call void @right(i64 %p)
+  call void @right(i64 %p)
+  call void @right(i64 %p)
+  ret void
+}
+
+; CHECK-LABEL: @right
+; CHECK-LABEL: entry-block
+; CHECK-LABEL: call void @left(i64 %p)
+define void @right(i64 %p) {
+entry-block:
+  call void @left(i64 %p)
+  call void @left(i64 %p)
+  call void @left(i64 %p)
+  call void @left(i64 %p)
+  ret void
+}





More information about the llvm-commits mailing list