aboutsummaryrefslogtreecommitdiffstats
path: root/test/Assembler/getelementptr_invalid_ptr.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/Assembler/getelementptr_invalid_ptr.ll')
-rw-r--r--test/Assembler/getelementptr_invalid_ptr.ll10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/Assembler/getelementptr_invalid_ptr.ll b/test/Assembler/getelementptr_invalid_ptr.ll
new file mode 100644
index 0000000..8922927
--- /dev/null
+++ b/test/Assembler/getelementptr_invalid_ptr.ll
@@ -0,0 +1,10 @@
+; RUN: not llvm-as < %s 2>&1 | FileCheck %s
+; Test the case of an invalid pointer type on a GEP
+
+; CHECK: base of getelementptr must be a pointer
+
+define i32* @foo(i32 %a) {
+ %gep = getelementptr i32, i32 %a, i32 1
+ return i32* %gep
+}
+