aboutsummaryrefslogtreecommitdiffstats
path: root/test/Assembler
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-07-27 21:53:46 +0000
committerDan Gohman <gohman@apple.com>2009-07-27 21:53:46 +0000
commitdd8004dc73d091ccb3927dbbc3b41639a3738ae3 (patch)
tree635ee4ff5a89aefb2eb5ba8394207f65c8771bcf /test/Assembler
parent9a7e2ccf574368b60455f8c8975030475a1f3ce0 (diff)
downloadexternal_llvm-dd8004dc73d091ccb3927dbbc3b41639a3738ae3.zip
external_llvm-dd8004dc73d091ccb3927dbbc3b41639a3738ae3.tar.gz
external_llvm-dd8004dc73d091ccb3927dbbc3b41639a3738ae3.tar.bz2
Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77259 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Assembler')
-rw-r--r--test/Assembler/flags-plain.ll5
-rw-r--r--test/Assembler/flags.ll19
2 files changed, 24 insertions, 0 deletions
diff --git a/test/Assembler/flags-plain.ll b/test/Assembler/flags-plain.ll
index 148d02f..bf3d5d8 100644
--- a/test/Assembler/flags-plain.ll
+++ b/test/Assembler/flags-plain.ll
@@ -21,3 +21,8 @@ define i64 @sdiv_plain_ce() {
; CHECK: ret i64 sdiv (i64 ptrtoint (i64* @addr to i64), i64 91)
ret i64 sdiv (i64 ptrtoint (i64* @addr to i64), i64 91)
}
+
+define i64* @gep_plain_ce() {
+; CHECK: ret i64* getelementptr (i64* @addr, i64 171)
+ ret i64* getelementptr (i64* @addr, i64 171)
+}
diff --git a/test/Assembler/flags.ll b/test/Assembler/flags.ll
index 4efb1cd..981a4e5 100644
--- a/test/Assembler/flags.ll
+++ b/test/Assembler/flags.ll
@@ -104,6 +104,18 @@ define i64 @sdiv_plain(i64 %x, i64 %y) {
ret i64 %z
}
+define i64* @gep_nw(i64* %p, i64 %x) {
+; CHECK: %z = getelementptr inbounds i64* %p, i64 %x
+ %z = getelementptr inbounds i64* %p, i64 %x
+ ret i64* %z
+}
+
+define i64* @gep_plain(i64* %p, i64 %x) {
+; CHECK: %z = getelementptr i64* %p, i64 %x
+ %z = getelementptr i64* %p, i64 %x
+ ret i64* %z
+}
+
define i64 @add_both_ce() {
; CHECK: ret i64 add nuw nsw (i64 ptrtoint (i64* @addr to i64), i64 91)
ret i64 add nsw nuw (i64 ptrtoint (i64* @addr to i64), i64 91)
@@ -123,3 +135,10 @@ define i64 @sdiv_exact_ce() {
; CHECK: ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91)
ret i64 sdiv exact (i64 ptrtoint (i64* @addr to i64), i64 91)
}
+
+define i64* @gep_nw_ce() {
+; CHECK: ret i64* getelementptr inbounds (i64* @addr, i64 171)
+ ret i64* getelementptr inbounds (i64* @addr, i64 171)
+}
+
+