[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / CodeGen / arm-bf16-params-returns.c
blob42cc287814151e5f547e8e4f154e3056a253100d
1 // RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi hard -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefix=CHECK32-HARD
2 // RUN: %clang_cc1 -triple armv8.6a-arm-none-eabi -target-abi aapcs -mfloat-abi softfp -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefix=CHECK32-SOFTFP
3 // RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -target-feature +bf16 -target-feature +neon -emit-llvm -O2 -o - %s | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefixes=CHECK64,CHECK64NEON
4 // RUN: %clang_cc1 -triple aarch64-arm-none-eabi -target-abi aapcs -target-feature -bf16 -target-feature +neon -DNONEON -emit-llvm -O2 -o - %s | opt -S -passes=mem2reg,sroa | FileCheck %s --check-prefix=CHECK64
6 // REQUIRES: aarch64-registered-target || arm-registered-target
8 #include <arm_neon.h>
10 // function return types
11 __bf16 test_ret_bf16(__bf16 v) {
12 return v;
14 // CHECK32-HARD: define{{.*}} arm_aapcs_vfpcc bfloat @test_ret_bf16(bfloat noundef returned %v) {{.*}} {
15 // CHECK32-HARD: ret bfloat %v
16 // CHECK32-SOFTFP: define{{.*}} bfloat @test_ret_bf16(bfloat noundef returned %v) {{.*}} {
17 // CHECK32-SOFTFP: ret bfloat %v
18 // CHECK64: define{{.*}} bfloat @test_ret_bf16(bfloat noundef returned %v) {{.*}} {
19 // CHECK64: ret bfloat %v
21 #ifndef NONEON
23 bfloat16x4_t test_ret_bf16x4_t(bfloat16x4_t v) {
24 return v;
26 // CHECK32-HARD: define{{.*}} arm_aapcs_vfpcc <4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> noundef returned %v) {{.*}} {
27 // CHECK32-HARD: ret <4 x bfloat> %v
28 // CHECK32-SOFTFP: define{{.*}} <2 x i32> @test_ret_bf16x4_t(<2 x i32> [[V0:.*]]) {{.*}} {
29 // CHECK32-SOFTFP: ret <2 x i32> %v
30 // CHECK64NEON: define{{.*}} <4 x bfloat> @test_ret_bf16x4_t(<4 x bfloat> noundef returned %v) {{.*}} {
31 // CHECK64NEON: ret <4 x bfloat> %v
33 #endif