[docs] Add LICENSE.txt to the root of the mono-repo
[llvm-project.git] / clang / test / CodeGenSYCL / unique_stable_name_windows_diff.cpp
blob7c7979f712f0511182d036949792cd5f7342b190
1 // RUN: %clang_cc1 -triple spir64-unknown-unknown-sycldevice -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s
2 // RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s
5 template<typename KN, typename Func>
6 __attribute__((sycl_kernel)) void kernel(Func F){
7 F();
10 template<typename KN, typename Func>
11 __attribute__((sycl_kernel)) void kernel2(Func F){
12 F(1);
15 template<typename KN, typename Func>
16 __attribute__((sycl_kernel)) void kernel3(Func F){
17 F(1.1);
20 int main() {
21 int i;
22 double d;
23 float f;
24 auto lambda1 = [](){};
25 auto lambda2 = [](int){};
26 auto lambda3 = [](double){};
28 kernel<class K1>(lambda1);
29 kernel2<class K2>(lambda2);
30 kernel3<class K3>(lambda3);
32 // Ensure the kernels are named the same between the device and host
33 // invocations.
34 (void)__builtin_sycl_unique_stable_name(decltype(lambda1));
35 (void)__builtin_sycl_unique_stable_name(decltype(lambda2));
36 (void)__builtin_sycl_unique_stable_name(decltype(lambda3));
38 // Make sure the following 3 are the same between the host and device compile.
39 // Note that these are NOT the same value as eachother, they differ by the
40 // signature.
41 // CHECK: private unnamed_addr constant [17 x i8] c"_ZTSZ4mainEUlvE_\00"
42 // CHECK: private unnamed_addr constant [17 x i8] c"_ZTSZ4mainEUliE_\00"
43 // CHECK: private unnamed_addr constant [17 x i8] c"_ZTSZ4mainEUldE_\00"