
For newer OpenCL extensions that do not require a pragma, such as `cl_khr_subgroup_shuffle`, a user could still accidentally attempt to use a pragma. This would result in a warning "unknown OpenCL extension 'cl_khr_subgroup_shuffle' - ignoring" which could be mistakenly interpreted as "clang does not support this extension at all" instead of "clang does not require any pragma for this extension". Differential Revision: https://reviews.llvm.org/D126660
16 lines
789 B
Common Lisp
16 lines
789 B
Common Lisp
// RUN: %clang_cc1 %s -verify -pedantic -Wno-empty-translation-unit -fsyntax-only -triple spir-unknown-unknown
|
|
|
|
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
|
|
|
|
#pragma OPENCL EXTENSION cl_no_such_extension : disable /* expected-warning {{OpenCL extension 'cl_no_such_extension' unknown or does not require pragma - ignoring}} */
|
|
|
|
#pragma OPENCL EXTENSION all : disable
|
|
#pragma OPENCL EXTENSION all : enable /* expected-warning {{expected 'disable' - ignoring}} */
|
|
|
|
#pragma OPENCL EXTENSION cl_khr_fp64 : on /* expected-warning {{expected 'enable', 'disable', 'begin' or 'end' - ignoring}} */
|
|
|
|
#pragma OPENCL FP_CONTRACT ON
|
|
#pragma OPENCL FP_CONTRACT OFF
|
|
#pragma OPENCL FP_CONTRACT DEFAULT
|
|
#pragma OPENCL FP_CONTRACT FOO // expected-warning {{expected 'ON' or 'OFF' or 'DEFAULT' in pragma}}
|