| 1 |
// REQUIRES: powerpc-registered-target |
| 2 |
// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -target-cpu pwr9 \ |
| 3 |
// RUN: -fsyntax-only -Wall -Werror -verify %s |
| 4 |
// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -target-cpu pwr9 \ |
| 5 |
// RUN: -fsyntax-only -Wall -Werror -verify %s |
| 6 |
// RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr9 \ |
| 7 |
// RUN: -fsyntax-only -Wall -Werror -verify %s |
| 8 |
// RUN: %clang_cc1 -triple powerpc-unknown-aix -target-cpu pwr9 \ |
| 9 |
// RUN: -fsyntax-only -Wall -Werror -verify %s |
| 10 |
|
| 11 |
extern unsigned int ui; |
| 12 |
extern unsigned long long ull; |
| 13 |
extern long long ll; |
| 14 |
extern float f; |
| 15 |
extern double d; |
| 16 |
|
| 17 |
void test_builtin_ppc_cmprb() { |
| 18 |
int res = __builtin_ppc_cmprb(3, ui, ui); // expected-error {{argument value 3 is outside the valid range [0, 1]}} |
| 19 |
} |
| 20 |
|
| 21 |
#ifdef __PPC64__ |
| 22 |
|
| 23 |
void test_builtin_ppc_addex() { |
| 24 |
long long res = __builtin_ppc_addex(ll, ll, 4); // expected-error {{argument value 4 is outside the valid range [0, 3]}} |
| 25 |
unsigned long long res2 = __builtin_ppc_addex(ull, ull, -1); // expected-error {{argument value -1 is outside the valid range [0, 3]}} |
| 26 |
} |
| 27 |
|
| 28 |
#endif |
| 29 |
|
| 30 |
int test_builtin_ppc_test_data_class_d() { |
| 31 |
return __builtin_ppc_test_data_class(d, -1); // expected-error {{argument value -1 is outside the valid range [0, 127]}} |
| 32 |
} |
| 33 |
|
| 34 |
int test_builtin_ppc_test_data_class_f() { |
| 35 |
return __builtin_ppc_test_data_class(f, -1); // expected-error {{argument value -1 is outside the valid range [0, 127]}} |
| 36 |
} |
| 37 |
|
| 38 |
int test_test_data_class_d() { |
| 39 |
return __test_data_class(d, 128); // expected-error {{argument value 128 is outside the valid range [0, 127]}} |
| 40 |
} |
| 41 |
|
| 42 |
int test_test_data_class_f() { |
| 43 |
return __test_data_class(f, 128); // expected-error {{argument value 128 is outside the valid range [0, 127]}} |
| 44 |
} |
| 45 |
|
| 46 |
int test_test_data_class_type() { |
| 47 |
return __test_data_class(ui, 0); // expected-error {{expected a 'float', 'double' or '__float128' for the first argument}} |
| 48 |
} |