brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 7ddd82f Raw
49 lines · c
1// REQUIRES: powerpc-registered-target2// RUN: %clang_cc1 -triple powerpc64-unknown-linux-gnu -target-cpu pwr9 \3// RUN:   -fsyntax-only -Wall -Werror -verify %s4// RUN: %clang_cc1 -triple powerpc64le-unknown-linux-gnu -target-cpu pwr9 \5// RUN:   -fsyntax-only -Wall -Werror -verify %s6// RUN: %clang_cc1 -triple powerpc64-unknown-aix -target-cpu pwr9 \7// RUN:   -fsyntax-only -Wall -Werror -verify %s8// RUN: %clang_cc1 -triple powerpc-unknown-aix -target-cpu pwr9 \9// RUN:   -fsyntax-only -Wall -Werror -verify %s10 11extern unsigned int ui;12extern unsigned long long ull;13extern long long ll;14extern float f;15extern double d;16 17void 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 23void 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#endif29 30int 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 34int 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 38int 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 42int 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 46int 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}49