[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaSYCL / bf16.cpp
blobd1b4776f34044185a53d703bf0e52394c0197283
1 // RUN: %clang_cc1 -triple spir64 -aux-triple x86_64-unknown-linux-gnu -fsycl-is-device -verify -fsyntax-only %s
3 template <typename Name, typename Func>
4 __attribute__((sycl_kernel)) void kernel(const Func &kernelFunc) {
5 kernelFunc(); // expected-note {{called by 'kernel}}
8 void host_ok(void) {
9 __bf16 A;
12 int main()
13 { host_ok();
14 __bf16 var; // expected-note {{'var' defined here}}
15 kernel<class variables>([=]() {
16 (void)var; // expected-error {{'var' requires 16 bit size '__bf16' type support, but target 'spir64' does not support it}}
17 int B = sizeof(__bf16);
18 });
20 return 0;