summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/poly-unsigned.cpp
diff options
context:
space:
mode:
authorTim Northover <tnorthover@apple.com>2014-03-29 15:09:45 +0000
committerTim Northover <tnorthover@apple.com>2014-03-29 15:09:45 +0000
commit7e0e8ef787107d4f646254130625d83c67a617bf (patch)
tree8ff59170f29defadd4d7bea0156c174fd1619a4d /test/CodeGenCXX/poly-unsigned.cpp
parent6614bf2dd1f7e09bbef38b243fd42f7182897908 (diff)
ARM64: initial clang support commit.
This adds Clang support for the ARM64 backend. There are definitely still some rough edges, so please bring up any issues you see with this patch. As with the LLVM commit though, we think it'll be more useful for merging with AArch64 from within the tree. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@205100 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGenCXX/poly-unsigned.cpp')
-rw-r--r--test/CodeGenCXX/poly-unsigned.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/test/CodeGenCXX/poly-unsigned.cpp b/test/CodeGenCXX/poly-unsigned.cpp
new file mode 100644
index 0000000000..9851a06089
--- /dev/null
+++ b/test/CodeGenCXX/poly-unsigned.cpp
@@ -0,0 +1,20 @@
+// RUN: %clang_cc1 -triple arm64-apple-ios -ffreestanding -S -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-UNSIGNED-POLY %s
+// RUN: %clang_cc1 -triple arm64-linux-gnu -ffreestanding -S -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-UNSIGNED-POLY %s
+// RUN: %clang_cc1 -triple armv7-apple-ios -ffreestanding -target-cpu cortex-a8 -S -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-SIGNED-POLY %s
+
+#include <arm_neon.h>
+
+// Polynomial types really should be universally unsigned, otherwise casting
+// (say) poly8_t "x^7" to poly16_t would change it to "x^15 + x^14 + ... +
+// x^7". Unfortunately 32-bit ARM ended up in a slightly delicate ABI situation
+// so for now it got that wrong.
+
+poly16_t test_poly8(poly8_t pIn) {
+// CHECK-UNSIGNED-POLY: @_Z10test_poly8h
+// CHECK-UNSIGNED-POLY: zext i8 {{.*}} to i16
+
+// CHECK-SIGNED-POLY: @_Z10test_poly8a
+// CHECK-SIGNED-POLY: sext i8 {{.*}} to i16
+
+ return pIn;
+}