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