aboutsummaryrefslogtreecommitdiffstats
path: root/test/CodeGen/ARM64/register-offset-addressing.ll
diff options
context:
space:
mode:
Diffstat (limited to 'test/CodeGen/ARM64/register-offset-addressing.ll')
-rw-r--r--test/CodeGen/ARM64/register-offset-addressing.ll12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/CodeGen/ARM64/register-offset-addressing.ll b/test/CodeGen/ARM64/register-offset-addressing.ll
new file mode 100644
index 0000000..c273602
--- /dev/null
+++ b/test/CodeGen/ARM64/register-offset-addressing.ll
@@ -0,0 +1,12 @@
+; RUN: llc < %s -mtriple=arm64-apple-darwin | FileCheck %s
+
+define i8 @t1(i16* %a, i64 %b) {
+; CHECK: t1
+; CHECK: lsl [[REG:x[0-9]+]], x1, #1
+; CHECK: ldrb w0, [x0, [[REG]]]
+; CHECK: ret
+ %tmp1 = getelementptr inbounds i16* %a, i64 %b
+ %tmp2 = load i16* %tmp1
+ %tmp3 = trunc i16 %tmp2 to i8
+ ret i8 %tmp3
+}