From 68bae4ff19ae3b3fb54d3c36cbfa455b1fe97944 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sun, 11 Jan 2004 23:56:03 +0000 Subject: [PATCH] This isn't really an assembler test. This tests to make sure the ConstantExpr::getGetElementPtr method folds two getelementptr instructions when possible. llvm-svn: 10758 --- .../Assembler/2004-01-11-getelementptrfolding.llx | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 test/Regression/Assembler/2004-01-11-getelementptrfolding.llx diff --git a/test/Regression/Assembler/2004-01-11-getelementptrfolding.llx b/test/Regression/Assembler/2004-01-11-getelementptrfolding.llx new file mode 100644 index 00000000000..6f7f06a9b24 --- /dev/null +++ b/test/Regression/Assembler/2004-01-11-getelementptrfolding.llx @@ -0,0 +1,11 @@ +; RUN: llvm-as < %s | llvm-dis | not grep 'getelementptr.*getelementptr' + + %struct.TUVVertex = type { short, short, short, short } + %struct.TTriangleItem = type { sbyte*, sbyte*, [3 x %struct.TUVVertex] } + +%data_triangleItems = internal constant [2908 x %struct.TTriangleItem] zeroinitializer + +void %foo() { + store short 0, short* getelementptr ([3 x %struct.TUVVertex]* getelementptr ([2908 x %struct.TTriangleItem]* %data_triangleItems, long 0, long 0, ubyte 2), long 0, long 0, ubyte 0) + ret void +}