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