From 827cde1c8319e51463007078a7ce3660ebc93036 Mon Sep 17 00:00:00 2001 From: Duncan Sands Date: Sun, 25 Nov 2007 14:10:56 +0000 Subject: =?UTF-8?q?Fix=20PR1816.=20=20If=20a=20bitcast=20of=20a=20function?= =?UTF-8?q?=20only=20exists=20because=20of=20a=20trivial=20difference=20in?= =?UTF-8?q?=20function=20attributes,=20allow=20calls=20to=20it=20to=20be?= =?UTF-8?q?=20converted=20to=20direct=20calls.=20=20Based=20on=20a=20patch?= =?UTF-8?q?=20by=20T=C3=B6r=C3=B6k=20Edwin.=20While=20there,=20move=20the?= =?UTF-8?q?=20various=20lists=20of=20mutually=20incompatible=20parameters?= =?UTF-8?q?=20etc=20out=20of=20the=20verifier=20and=20into=20ParameterAttr?= =?UTF-8?q?ibutes.h.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44315 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../InstCombine/2007-11-25-CompatibleAttributes.ll | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll (limited to 'test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll') diff --git a/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll new file mode 100644 index 0000000000..60a4b3b4ab --- /dev/null +++ b/test/Transforms/InstCombine/2007-11-25-CompatibleAttributes.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | opt -instcombine | llvm-dis | not grep bitcast +; PR1716 + +@.str = internal constant [4 x i8] c"%d\0A\00" ; <[4 x i8]*> [#uses=1] + +define i32 @main(i32 %argc, i8** %argv) { +entry: + %tmp32 = tail call i32 (i8* noalias , ...) nounwind * bitcast (i32 (i8*, ...) nounwind * @printf to i32 (i8* noalias , ...) nounwind *)( i8* getelementptr ([4 x i8]* @.str, i32 0, i32 0) noalias , i32 0 ) nounwind ; [#uses=0] + ret i32 undef +} + +declare i32 @printf(i8*, ...) nounwind -- cgit v1.2.3