[OpenCL] Add OpenCL builtin test generator
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Wed, 9 Jun 2021 11:43:50 +0000 (12:43 +0100)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Wed, 9 Jun 2021 13:03:58 +0000 (14:03 +0100)
commit8866793b4e0abd31e4f57abf9ba832d691a3a3e1
tree4e2288d76151ea98fe1e85afa145f208aa081613
parent630820bafc6866ce1efa4f1e2c4b11f6250eae9c
[OpenCL] Add OpenCL builtin test generator

Add a new clang-tblgen flag `-gen-clang-opencl-builtin-tests` that
generates a .cl file containing calls to every builtin function
defined in the .td input.

This patch does not add any use of the new flag yet, so the only way
to obtain a generated test file is through a manual invocation of
clang-tblgen.  A test making use of this emitter will be added in a
followup commit.

Differential Revision: https://reviews.llvm.org/D97869
clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
clang/utils/TableGen/TableGen.cpp
clang/utils/TableGen/TableGenBackends.h