xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/poly-unsigned.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple arm64-apple-ios -target-feature +neon -ffreestanding -S -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-UNSIGNED-POLY %s
2*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple arm64-linux-gnu -target-feature +neon -ffreestanding -S -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-UNSIGNED-POLY %s
3*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -triple armv7-apple-ios -ffreestanding -target-cpu cortex-a8 -S -emit-llvm -o - %s | FileCheck --check-prefix=CHECK-SIGNED-POLY %s
4*0a6a1f1dSLionel Sambuc 
5*0a6a1f1dSLionel Sambuc #include <arm_neon.h>
6*0a6a1f1dSLionel Sambuc 
7*0a6a1f1dSLionel Sambuc // Polynomial types really should be universally unsigned, otherwise casting
8*0a6a1f1dSLionel Sambuc // (say) poly8_t "x^7" to poly16_t would change it to "x^15 + x^14 + ... +
9*0a6a1f1dSLionel Sambuc // x^7". Unfortunately 32-bit ARM ended up in a slightly delicate ABI situation
10*0a6a1f1dSLionel Sambuc // so for now it got that wrong.
11*0a6a1f1dSLionel Sambuc 
test_poly8(poly8_t pIn)12*0a6a1f1dSLionel Sambuc poly16_t test_poly8(poly8_t pIn) {
13*0a6a1f1dSLionel Sambuc // CHECK-UNSIGNED-POLY: @_Z10test_poly8h
14*0a6a1f1dSLionel Sambuc // CHECK-UNSIGNED-POLY: zext i8 {{.*}} to i16
15*0a6a1f1dSLionel Sambuc 
16*0a6a1f1dSLionel Sambuc // CHECK-SIGNED-POLY: @_Z10test_poly8a
17*0a6a1f1dSLionel Sambuc // CHECK-SIGNED-POLY: sext i8 {{.*}} to i16
18*0a6a1f1dSLionel Sambuc 
19*0a6a1f1dSLionel Sambuc   return pIn;
20*0a6a1f1dSLionel Sambuc }
21