From dd8004dc73d091ccb3927dbbc3b41639a3738ae3 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 27 Jul 2009 21:53:46 +0000 Subject: 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 --- test/Assembler/flags-plain.ll | 5 +++++ test/Assembler/flags.ll | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) (limited to 'test/Assembler') 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) +} + + -- cgit v1.1