summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorSanjiv Gupta <sanjiv.gupta@microchip.com>2009-04-26 17:14:35 +0000
committerSanjiv Gupta <sanjiv.gupta@microchip.com>2009-04-26 17:14:35 +0000
commit9341c808ae684aeddcb4a926be3e3af62be22518 (patch)
tree9c93e7b6daa166bd676e68022e6881ef08ad7e4e /test
parentefdb3bc8d058981d4d03771a839fd262d0e43172 (diff)
downloadexternal_llvm-9341c808ae684aeddcb4a926be3e3af62be22518.zip
external_llvm-9341c808ae684aeddcb4a926be3e3af62be22518.tar.gz
external_llvm-9341c808ae684aeddcb4a926be3e3af62be22518.tar.bz2
Any size of integral indices are allowed in gep for indexing into sequential types. Also adding a test case to check the indices type allowed into struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70134 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Assembler/getelementptr_struct.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/Assembler/getelementptr_struct.ll b/test/Assembler/getelementptr_struct.ll
new file mode 100644
index 0000000..c8779a6
--- /dev/null
+++ b/test/Assembler/getelementptr_struct.ll
@@ -0,0 +1,12 @@
+; RUN: not llvm-as < %s >/dev/null |& grep {invalid getelementptr indices}
+; Test the case of a incorrect indices type into struct
+
+%RT = type { i8 , [10 x [20 x i32]], i8 }
+%ST = type { i32, double, %RT }
+
+define i32* @foo(%ST* %s) {
+entry:
+ %reg = getelementptr %ST* %s, i32 1, i64 2, i32 1, i32 5, i32 13
+ ret i32* %reg
+}
+