From 77b0b852fad6397db36a14c85dac8747d0fb9211 Mon Sep 17 00:00:00 2001 From: Stepan Dyatkovskiy Date: Mon, 9 Jun 2014 19:03:02 +0000 Subject: [PATCH] =?UTF-8?q?Added=20functions=20cross-reference=20test.=20O?= =?UTF-8?q?riginally=20this=20similar=20was=20initiated=20by=20Bj=C3=B6rn?= =?UTF-8?q?=20Steinbrink=20here:=20http://reviews.llvm.org/D3437?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@210486 91177308-0d34-0410-b5e6-96231b3b80d8 --- test/Transforms/MergeFunc/functions.ll | 27 ++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 test/Transforms/MergeFunc/functions.ll diff --git a/test/Transforms/MergeFunc/functions.ll b/test/Transforms/MergeFunc/functions.ll new file mode 100644 index 00000000000..006fdf52367 --- /dev/null +++ b/test/Transforms/MergeFunc/functions.ll @@ -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 +}