Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Unified Diff: test/NaCl/ARM/avoid-aeabi-functions.ll

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/NaCl/ARM/GOT-with-disabled-constpools.ll ('k') | test/NaCl/ARM/blx-sandboxing.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/NaCl/ARM/avoid-aeabi-functions.ll
diff --git a/test/NaCl/ARM/avoid-aeabi-functions.ll b/test/NaCl/ARM/avoid-aeabi-functions.ll
new file mode 100644
index 0000000000000000000000000000000000000000..0e88c03039ca9e3bad3e3d870d0eec96bacb7b0b
--- /dev/null
+++ b/test/NaCl/ARM/avoid-aeabi-functions.ll
@@ -0,0 +1,37 @@
+; RUN: llc -mtriple armv7a-linux-gnueabihf < %s -o - \
+; RUN: | FileCheck %s --check-prefix=EABI
+; RUN: llc -mtriple armv7a-linux-gnueabihf < %s -o - \
+; RUN: -arm-enable-aeabi-functions=0 | FileCheck %s --check-prefix=NO_EABI
+; RUN: llc -mtriple armv7a-none-nacl-gnueabihf < %s -o - \
+; RUN: | FileCheck %s --check-prefix=NO_EABI
+
+; PNaCl's build of compiler-rt (libgcc.a) does not define __aeabi_*
+; functions for ARM yet. Test that the backend can avoid using these
+; __aeabi_* functions.
+
+define i64 @do_division(i64 %a, i64 %b) {
+ %div = udiv i64 %a, %b
+ ret i64 %div
+}
+; EABI-LABEL: do_division:
+; EABI: bl __aeabi_uldivmod
+; NO_EABI-LABEL: do_division:
+; NO_EABI: bl __udivdi3
+
+
+declare void @llvm.memset.p0i8.i32(i8* nocapture, i8, i32, i32, i1)
+
+; __aeabi_memset() has two arguments swapped compared with the normal
+; memset(), so check that both are handled correctly.
+define void @do_memset(i8* %addr) {
+ call void @llvm.memset.p0i8.i32(i8* %addr, i8 255, i32 100, i32 0, i1 false)
+ ret void
+}
+; EABI-LABEL: do_memset:
+; EABI: mov r1, #100
+; EABI: mov r2, #255
+; EABI: bl __aeabi_memset
+; NO_EABI-LABEL: do_memset:
+; NO_EABI: mov r1, #255
+; NO_EABI: mov r2, #100
+; NO_EABI: bl memset
« no previous file with comments | « test/NaCl/ARM/GOT-with-disabled-constpools.ll ('k') | test/NaCl/ARM/blx-sandboxing.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698