20 lines · plain
1// RUN: clang-tblgen -gen-clang-opencl-builtin-tests %clang_src_sema_dir/OpenCLBuiltins.td -o %t.cl2// RUN: %clang_cc1 -include %s %t.cl -triple spir -verify -fsyntax-only -cl-std=CL2.0 -finclude-default-header3// RUN: %clang_cc1 -include %s %t.cl -triple spir -verify -fsyntax-only -cl-std=CL2.0 -fdeclare-opencl-builtins -finclude-default-header4 5// Generate an OpenCL source file containing a call to each builtin from6// OpenCLBuiltins.td and then run that generated source file through the7// frontend.8//9// Then test that:10// - The generated file can be parsed using opencl-c.h, giving some confidence11// that OpenCLBuiltins.td does not provide more than what opencl-c.h provides12// (but not vice versa).13//14// - The generated file can be parsed using -fdeclare-opencl-builtins, ensuring15// some internal consistency of declarations in OpenCLBuiltins.td. For16// example, addition of builtin declarations that lead to ambiguity during17// overload resolution will cause this test to fail.18 19// expected-no-diagnostics20