After the change of constant address space function scope variable in 6e34f0e ("[OpenCL] Emit function-scope variable in constant address space as static variable", 2017-05-15) a bug has been introduced that triggered unreachable during generation of samplers.
This is because sampler in global scope has not to be generated. The initialization function has to be used instead of a variable everywhere the sampler variable is being referenced.
This patch fixes the bug and adds missing test case.