From 6a7096e6850ab0e2090c82ec4fb02f1b2317e632 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 9 Oct 2002 17:44:34 +0000 Subject: [PATCH] Cleanup testcase a lot to test JUST funcresolve of globals git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4095 91177308-0d34-0410-b5e6-96231b3b80d8 --- .../2002-08-19-ResolveGlobalVars.ll | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVars.ll b/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVars.ll index 7dfbf900604..0da78ee9d0c 100644 --- a/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVars.ll +++ b/test/Transforms/FunctionResolve/2002-08-19-ResolveGlobalVars.ll @@ -1,25 +1,22 @@ -; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved correctly. +; Test that: extern int X[] and int X[] = { 1, 2, 3, 4 } are resolved +; correctly. ; -; RUN: if as < %s | opt -gcse -instcombine -constprop -dce | dis | grep getelementptr +; RUN: if as < %s | opt -funcresolve | dis | grep external ; RUN: then exit 1 ; RUN: else exit 0 ; RUN: fi ; -%X = uninitialized global int ; [#uses=1] -%X = global [4 x int] [ int 1, int 2, int 3, int 4 ] ; <[4 x int]*> [#uses=1] +%X = external global int +%X = global [4 x int] [ int 1, int 2, int 3, int 4 ] implementation ; Functions: int %foo(int %x) { bb1: ;[#uses=0] - %reg107-idxcast = cast int %x to uint ; [#uses=2] - %reg113 = getelementptr int* %X, uint %reg107-idxcast ; [#uses=1] - %reg120 = getelementptr [4 x int]* %X, uint 0, uint %reg107-idxcast ; [#uses=1] - %reg123 = sub int* %reg113, %reg120 ; [#uses=1] - %cast232 = cast int* %reg123 to long ; [#uses=1] - %reg234 = div long %cast232, 4 ; [#uses=1] - %cast108 = cast long %reg234 to int ; [#uses=1] - ret int %cast108 + store int 5, int* getelementptr (int* %X, long 2) + %F = getelementptr int* %X, long 2 + %val = load int* %F + ret int %val }