aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/BPF/select_ri.ll
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-16 14:44:35 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-16 14:44:35 +0000
commiteb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b (patch)
treeebe746b4779907cbdd7154030b623da2c5b926a6 /test/CodeGen/BPF/select_ri.ll
parentedad5bcb76bf472a1487c0f3dd94a5914213a647 (diff)
downloadsrc-eb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b.tar.gz
src-eb70dddbd77e120e5d490bd8fbe7ff3f8fa81c6b.zip
Vendor import of llvm 5.0.1 release r320880:vendor/llvm/llvm-release_501-r320880
Notes
Notes: svn path=/vendor/llvm/dist/; revision=326899 svn path=/vendor/llvm/llvm-release_501-r320880/; revision=326900; tag=vendor/llvm/llvm-release_501-r320880
Diffstat (limited to 'test/CodeGen/BPF/select_ri.ll')
-rw-r--r--test/CodeGen/BPF/select_ri.ll35
1 files changed, 35 insertions, 0 deletions
diff --git a/test/CodeGen/BPF/select_ri.ll b/test/CodeGen/BPF/select_ri.ll
index c4ac376502b8..3610d4016010 100644
--- a/test/CodeGen/BPF/select_ri.ll
+++ b/test/CodeGen/BPF/select_ri.ll
@@ -25,3 +25,38 @@ entry:
}
attributes #0 = { norecurse nounwind readonly }
+
+; test immediate out of 32-bit range
+; Source file:
+
+; unsigned long long
+; load_word(void *buf, unsigned long long off)
+; asm("llvm.bpf.load.word");
+;
+; int
+; foo(void *buf)
+; {
+; unsigned long long sum = 0;
+;
+; sum += load_word(buf, 100);
+; sum += load_word(buf, 104);
+;
+; if (sum != 0x1ffffffffULL)
+; return ~0U;
+;
+; return 0;
+;}
+
+; Function Attrs: nounwind readonly
+define i32 @foo(i8*) local_unnamed_addr #0 {
+ %2 = tail call i64 @llvm.bpf.load.word(i8* %0, i64 100)
+ %3 = tail call i64 @llvm.bpf.load.word(i8* %0, i64 104)
+ %4 = add i64 %3, %2
+ %5 = icmp ne i64 %4, 8589934591
+; CHECK: r{{[0-9]+}} = 8589934591ll
+ %6 = sext i1 %5 to i32
+ ret i32 %6
+}
+
+; Function Attrs: nounwind readonly
+declare i64 @llvm.bpf.load.word(i8*, i64) #1