From 84da5a6cc8fa7c1af9f91d2b1c19637110f7a60a Mon Sep 17 00:00:00 2001 From: Alkis Evlogimenos Date: Sun, 5 Dec 2004 01:44:46 +0000 Subject: [PATCH] Add testcast for bug475 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18513 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../2004-12-04-LazyCompileFuncs.ll | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll diff --git a/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll b/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll new file mode 100644 index 00000000000..318f60b712a --- /dev/null +++ b/test/ExecutionEngine/2004-12-04-LazyCompileFuncs.ll @@ -0,0 +1,36 @@ +; RUN: llvm-as -f %s -o %t.bc +; RUN: lli -debug-only=jit %t.bc 2>&1 | not grep 'G()' + +target endian = little +target pointersize = 32 +deplibs = [ "c", "crtend" ] +%.str_1 = internal constant [7 x sbyte] c"IN F!\0A\00" ; <[7 x sbyte]*> [#uses=1] +%.str_2 = internal constant [7 x sbyte] c"IN G!\0A\00" ; <[7 x sbyte]*> [#uses=1] +%Ptrs = internal constant [2 x void (...)*] [ void (...)* cast (void ()* %F to void (...)*), void (...)* cast (void ()* %G to void (...)*) ] ; <[2 x void (...)*]*> [#uses=1] + +implementation ; Functions: + +declare int %printf(sbyte*, ...) + +internal void %F() { +entry: + %tmp.0 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([7 x sbyte]* %.str_1, int 0, int 0) ) ; [#uses=0] + ret void +} + +internal void %G() { +entry: + %tmp.0 = call int (sbyte*, ...)* %printf( sbyte* getelementptr ([7 x sbyte]* %.str_2, int 0, int 0) ) ; [#uses=0] + ret void +} + +int %main(int %argc, sbyte** %argv) { +entry: + %tmp.3 = and int %argc, 1 ; [#uses=1] + %tmp.4 = getelementptr [2 x void (...)*]* %Ptrs, int 0, int %tmp.3 ; [#uses=1] + %tmp.5 = load void (...)** %tmp.4 ; [#uses=1] + %tmp.5_c = cast void (...)* %tmp.5 to void ()* ; [#uses=1] + call void %tmp.5_c( ) + ret int undef +} + -- 2.34.1