brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.4 KiB · cffcc2c Raw
47 lines · plain
1//RUN: %clang_cc1 %s -verify -fsyntax-only -triple spir2//RUN: %clang_cc1 %s -verify -fsyntax-only -DFPTREXT -triple spir3 4#ifdef FPTREXT5#pragma OPENCL EXTENSION __cl_clang_function_pointers : enable6#endif // FPTREXT7 8// References to functions are not allowed.9struct myclass {10//FIXME: Here we provide incorrect diagnostic.11  void (&mem)(); //expected-error{{reference to function type cannot have '__generic' qualifier}}12};13 14void (&glob)();15#ifndef FPTREXT16//expected-error@-2{{references to functions are not allowed}}17#else18//expected-error@-4{{declaration of reference variable 'glob' requires an initializer}}19#endif // FPTREXT20 21using ref2fct_t = void (&)();22#ifndef FPTREXT23//expected-error@-2{{references to functions are not allowed}}24#endif // FPTREXT25typedef void (&ref2fct_t)();26#ifndef FPTREXT27//expected-error@-2{{references to functions are not allowed}}28#endif // FPTREXT29 30void test(void (&par)()) {31#ifndef FPTREXT32//expected-error@-2{{references to functions are not allowed}}33#endif // FPTREXT34  void (&loc)();35#ifndef FPTREXT36//expected-error@-2{{references to functions are not allowed}}37#else38//expected-error@-4{{declaration of reference variable 'loc' requires an initializer}}39#endif // FPTREXT40 41  void (*&ref2fptr)();42#ifndef FPTREXT43//expected-error@-2{{pointers to functions are not allowed}}44#endif // FPTREXT45//expected-error@-4{{declaration of reference variable 'ref2fptr' requires an initializer}}46}47