[OpenCL] Fix `mix` builtin overloads
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Fri, 5 Mar 2021 13:43:30 +0000 (13:43 +0000)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Fri, 5 Mar 2021 13:43:30 +0000 (13:43 +0000)
commitf0686569cc5789f93d76461143c232882b7ff2e9
tree3eba047d9c64032d180a2ed5eb17814393329cf8
parent9c0069d836b326f3ae0b92a8f095b0707a944ed0
[OpenCL] Fix `mix` builtin overloads

`mix` is subtly different from `clamp`: in the overloads where the
last argument is a scalar, the second argument should be a gentype for
`mix`.

As scalars can be implicitly converted to vectors, this cannot be
caught in the Sema test.  Hence adding a CodeGen test, where we can
verify the types using the mangled name.
clang/lib/Sema/OpenCLBuiltins.td
clang/test/CodeGenOpenCL/fdeclare-opencl-builtins.cl