1 // RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify %s
2 // RUN: %clang_cc1 -DSVE_OVERLOADED_FORMS -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -fsyntax-only -verify %s
3 
4 #ifdef SVE_OVERLOADED_FORMS
5 // A simple used,unused... macro, long enough to represent any SVE builtin.
6 #define SVE_ACLE_FUNC(A1,A2_UNUSED,A3,A4_UNUSED) A1##A3
7 #else
8 #define SVE_ACLE_FUNC(A1,A2,A3,A4) A1##A2##A3##A4
9 #endif
10 
11 #include <arm_sve.h>
12 
test_svcadd_f16_z(svbool_t pg,svfloat16_t op1,svfloat16_t op2)13 svfloat16_t test_svcadd_f16_z(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
14 {
15   // expected-error@+1 {{argument should be the value 90 or 270}}
16   return SVE_ACLE_FUNC(svcadd,_f16,_z,)(pg, op1, op2, 0);
17 }
18 
test_svcadd_f16_z_1(svbool_t pg,svfloat16_t op1,svfloat16_t op2)19 svfloat16_t test_svcadd_f16_z_1(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
20 {
21   // expected-error@+1 {{argument should be the value 90 or 270}}
22   return SVE_ACLE_FUNC(svcadd,_f16,_z,)(pg, op1, op2, 272);
23 }
24 
test_svcadd_f16_z_2(svbool_t pg,svfloat16_t op1,svfloat16_t op2)25 svfloat16_t test_svcadd_f16_z_2(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
26 {
27   // expected-error@+1 {{argument should be the value 90 or 270}}
28   return SVE_ACLE_FUNC(svcadd,_f16,_z,)(pg, op1, op2, 91);
29 }
30 
test_svcadd_f16_z_3(svbool_t pg,svfloat16_t op1,svfloat16_t op2)31 svfloat16_t test_svcadd_f16_z_3(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
32 {
33   // expected-error@+1 {{argument should be the value 90 or 270}}
34   return SVE_ACLE_FUNC(svcadd,_f16,_z,)(pg, op1, op2, 180);
35 }
36 
test_svcadd_f16_z_4(svbool_t pg,svfloat16_t op1,svfloat16_t op2)37 svfloat16_t test_svcadd_f16_z_4(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
38 {
39   // expected-error@+1 {{argument should be the value 90 or 270}}
40   return SVE_ACLE_FUNC(svcadd,_f16,_z,)(pg, op1, op2, 271);
41 }
42 
test_svcadd_f32_z(svbool_t pg,svfloat32_t op1,svfloat32_t op2)43 svfloat32_t test_svcadd_f32_z(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
44 {
45   // expected-error@+1 {{argument should be the value 90 or 270}}
46   return SVE_ACLE_FUNC(svcadd,_f32,_z,)(pg, op1, op2, 0);
47 }
48 
test_svcadd_f64_z(svbool_t pg,svfloat64_t op1,svfloat64_t op2)49 svfloat64_t test_svcadd_f64_z(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
50 {
51   // expected-error@+1 {{argument should be the value 90 or 270}}
52   return SVE_ACLE_FUNC(svcadd,_f64,_z,)(pg, op1, op2, 0);
53 }
54 
test_svcadd_f16_m(svbool_t pg,svfloat16_t op1,svfloat16_t op2)55 svfloat16_t test_svcadd_f16_m(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
56 {
57   // expected-error@+1 {{argument should be the value 90 or 270}}
58   return SVE_ACLE_FUNC(svcadd,_f16,_m,)(pg, op1, op2, 0);
59 }
60 
test_svcadd_f32_m(svbool_t pg,svfloat32_t op1,svfloat32_t op2)61 svfloat32_t test_svcadd_f32_m(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
62 {
63   // expected-error@+1 {{argument should be the value 90 or 270}}
64   return SVE_ACLE_FUNC(svcadd,_f32,_m,)(pg, op1, op2, 0);
65 }
66 
test_svcadd_f64_m(svbool_t pg,svfloat64_t op1,svfloat64_t op2)67 svfloat64_t test_svcadd_f64_m(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
68 {
69   // expected-error@+1 {{argument should be the value 90 or 270}}
70   return SVE_ACLE_FUNC(svcadd,_f64,_m,)(pg, op1, op2, 0);
71 }
72 
test_svcadd_f16_x(svbool_t pg,svfloat16_t op1,svfloat16_t op2)73 svfloat16_t test_svcadd_f16_x(svbool_t pg, svfloat16_t op1, svfloat16_t op2)
74 {
75   // expected-error@+1 {{argument should be the value 90 or 270}}
76   return SVE_ACLE_FUNC(svcadd,_f16,_x,)(pg, op1, op2, 0);
77 }
78 
test_svcadd_f32_x(svbool_t pg,svfloat32_t op1,svfloat32_t op2)79 svfloat32_t test_svcadd_f32_x(svbool_t pg, svfloat32_t op1, svfloat32_t op2)
80 {
81   // expected-error@+1 {{argument should be the value 90 or 270}}
82   return SVE_ACLE_FUNC(svcadd,_f32,_x,)(pg, op1, op2, 0);
83 }
84 
test_svcadd_f64_x(svbool_t pg,svfloat64_t op1,svfloat64_t op2)85 svfloat64_t test_svcadd_f64_x(svbool_t pg, svfloat64_t op1, svfloat64_t op2)
86 {
87   // expected-error@+1 {{argument should be the value 90 or 270}}
88   return SVE_ACLE_FUNC(svcadd,_f64,_x,)(pg, op1, op2, 0);
89 }
90