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_svqincb_n_s32(int32_t op)13 int32_t test_svqincb_n_s32(int32_t op)
14 {
15   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
16   return SVE_ACLE_FUNC(svqincb,_n_s32,,)(op, 0);
17 }
18 
test_svqincb_n_s32_1(int32_t op)19 int32_t test_svqincb_n_s32_1(int32_t op)
20 {
21   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
22   return SVE_ACLE_FUNC(svqincb,_n_s32,,)(op, 17);
23 }
24 
test_svqincb_n_s64(int64_t op)25 int64_t test_svqincb_n_s64(int64_t op)
26 {
27   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
28   return SVE_ACLE_FUNC(svqincb,_n_s64,,)(op, 0);
29 }
30 
test_svqincb_n_s64_1(int64_t op)31 int64_t test_svqincb_n_s64_1(int64_t op)
32 {
33   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
34   return SVE_ACLE_FUNC(svqincb,_n_s64,,)(op, 17);
35 }
36 
test_svqincb_n_u32(uint32_t op)37 uint32_t test_svqincb_n_u32(uint32_t op)
38 {
39   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
40   return SVE_ACLE_FUNC(svqincb,_n_u32,,)(op, 0);
41 }
42 
test_svqincb_n_u32_1(uint32_t op)43 uint32_t test_svqincb_n_u32_1(uint32_t op)
44 {
45   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
46   return SVE_ACLE_FUNC(svqincb,_n_u32,,)(op, 17);
47 }
48 
test_svqincb_n_u64(uint64_t op)49 uint64_t test_svqincb_n_u64(uint64_t op)
50 {
51   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
52   return SVE_ACLE_FUNC(svqincb,_n_u64,,)(op, 0);
53 }
54 
test_svqincb_n_u64_1(uint64_t op)55 uint64_t test_svqincb_n_u64_1(uint64_t op)
56 {
57   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
58   return SVE_ACLE_FUNC(svqincb,_n_u64,,)(op, 17);
59 }
60 
test_svqincb_pat_n_s32(int32_t op)61 int32_t test_svqincb_pat_n_s32(int32_t op)
62 {
63   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
64   return SVE_ACLE_FUNC(svqincb_pat,_n_s32,,)(op, SV_POW2, 0);
65 }
66 
test_svqincb_pat_n_s32_1(int32_t op)67 int32_t test_svqincb_pat_n_s32_1(int32_t op)
68 {
69   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
70   return SVE_ACLE_FUNC(svqincb_pat,_n_s32,,)(op, SV_VL1, 17);
71 }
72 
test_svqincb_pat_n_s64(int64_t op)73 int64_t test_svqincb_pat_n_s64(int64_t op)
74 {
75   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
76   return SVE_ACLE_FUNC(svqincb_pat,_n_s64,,)(op, SV_VL2, 0);
77 }
78 
test_svqincb_pat_n_s64_1(int64_t op)79 int64_t test_svqincb_pat_n_s64_1(int64_t op)
80 {
81   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
82   return SVE_ACLE_FUNC(svqincb_pat,_n_s64,,)(op, SV_VL3, 17);
83 }
84 
test_svqincb_pat_n_u32(uint32_t op)85 uint32_t test_svqincb_pat_n_u32(uint32_t op)
86 {
87   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
88   return SVE_ACLE_FUNC(svqincb_pat,_n_u32,,)(op, SV_VL4, 0);
89 }
90 
test_svqincb_pat_n_u32_1(uint32_t op)91 uint32_t test_svqincb_pat_n_u32_1(uint32_t op)
92 {
93   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
94   return SVE_ACLE_FUNC(svqincb_pat,_n_u32,,)(op, SV_VL5, 17);
95 }
96 
test_svqincb_pat_n_u64(uint64_t op)97 uint64_t test_svqincb_pat_n_u64(uint64_t op)
98 {
99   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
100   return SVE_ACLE_FUNC(svqincb_pat,_n_u64,,)(op, SV_VL6, 0);
101 }
102 
test_svqincb_pat_n_u64_1(uint64_t op)103 uint64_t test_svqincb_pat_n_u64_1(uint64_t op)
104 {
105   // expected-error-re@+1 {{argument value {{[0-9]+}} is outside the valid range [1, 16]}}
106   return SVE_ACLE_FUNC(svqincb_pat,_n_u64,,)(op, SV_VL7, 17);
107 }
108