21 lines · cpp
1// RUN: %clang_cc1 -x c++ %s -verify -DWITHOUT_FIXED_POINT2// RUN: %clang_cc1 -x c++ %s -verify -ffixed-point3 4#ifdef WITHOUT_FIXED_POINT5_Accum accum; // expected-error{{unknown type name '_Accum'}}6_Fract fract; // expected-error{{unknown type name '_Fract'}}7_Sat _Accum sat_accum; // expected-error{{unknown type name '_Sat'}}8 // expected-error@-1{{expected ';' after top level declarator}}9#endif10 11int accum_int = 10k; // expected-error{{invalid suffix 'k' on integer constant}}12int fract_int = 10r; // expected-error{{invalid suffix 'r' on integer constant}}13#ifdef WITHOUT_FIXED_POINT14float accum_flt = 0.0k; // expected-error{{invalid suffix 'k' on floating constant}}15float fract_flt = 0.0r; // expected-error{{invalid suffix 'r' on floating constant}}16#endif17 18#ifndef WITHOUT_FIXED_POINT19const char *c = 10.0k; // expected-error{{cannot initialize a variable of type 'const char *' with an rvalue of type '_Accum'}}20#endif21