From 73b5b5adae5fbacb1d48cdfebdff3a669cb79261 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 25 Apr 2009 22:20:49 +0000 Subject: [PATCH] add testcase for strange types of gep indices llvm-svn: 70085 --- llvm/test/Assembler/getelementptr.ll | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 llvm/test/Assembler/getelementptr.ll diff --git a/llvm/test/Assembler/getelementptr.ll b/llvm/test/Assembler/getelementptr.ll new file mode 100644 index 000000000000..10e5011397da --- /dev/null +++ b/llvm/test/Assembler/getelementptr.ll @@ -0,0 +1,12 @@ +; RUN: llvm-as < %s | llvm-dis | llvm-as | llvm-dis + +;; Verify that i16 indices work. +@x = external global {i32, i32} +@y = global i32* getelementptr ({i32, i32}* @x, i16 42, i32 0) + +; see if i92 indices work too. +define i32 *@test({i32, i32}* %t, i92 %n) { + %B = getelementptr {i32, i32}* %t, i92 %n, i32 0 + ret i32* %B +} +