[clang] [NFC][clang] Fix CodeGenSYCL::unique_stable_name_windows_diff test (PR #146854)

Mariya Podchishchaeva via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 3 06:08:04 PDT 2025


https://github.com/Fznamznon updated https://github.com/llvm/llvm-project/pull/146854

>From 9a640eefb5d27a65f236b5f7df1398bdf1bcc017 Mon Sep 17 00:00:00 2001
From: "Podchishchaeva, Mariya" <mariya.podchishchaeva at intel.com>
Date: Thu, 3 Jul 2025 03:46:41 -0700
Subject: [PATCH 1/2] [NFC][clang] Fix
 CodeGenSYCL::unique_stable_name_windows_diff test

The test checks x86 target in fsycl-is-device mode. x86 is not a valid
offloading target and IMO test meant to check fsycl-is-host mode to make
sure host invocations of __builtin_sycl_unique_stable_name work
correctly.
---
 .../test/CodeGenSYCL/unique_stable_name_windows_diff.cpp  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp b/clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp
index 7dd08a0c89255..70a09e4afd275 100644
--- a/clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp
+++ b/clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp
@@ -1,19 +1,19 @@
 // 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 '-D$ADDRSPACE=addrspace(1) '
-// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -fsycl-is-device -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE='
+// RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsycl-is-host -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE='
 
 
 template<typename KN, typename Func>
-__attribute__((sycl_kernel)) void kernel(Func F){
+[[clang::sycl_entry_point]] void kernel(Func F){
   F();
 }
 
 template<typename KN, typename Func>
-__attribute__((sycl_kernel)) void kernel2(Func F){
+[[clang::sycl_entry_point]] void kernel2(Func F){
   F(1);
 }
 
 template<typename KN, typename Func>
-__attribute__((sycl_kernel)) void kernel3(Func F){
+[[clang::sycl_entry_point]] void kernel3(Func F){
   F(1.1);
 }
 

>From 98182d4a04250ed10c15d0e36e68417ec9b00187 Mon Sep 17 00:00:00 2001
From: Mariya Podchishchaeva <mariya.podchishchaeva at intel.com>
Date: Thu, 3 Jul 2025 15:07:56 +0200
Subject: [PATCH 2/2] Apply suggestions from code review

Co-authored-by: Tom Honermann <tom at honermann.net>
---
 .../test/CodeGenSYCL/unique_stable_name_windows_diff.cpp  | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp b/clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp
index 70a09e4afd275..c844673db0d0e 100644
--- a/clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp
+++ b/clang/test/CodeGenSYCL/unique_stable_name_windows_diff.cpp
@@ -1,19 +1,19 @@
-// 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 '-D$ADDRSPACE=addrspace(1) '
+// RUN: %clang_cc1 -triple spir64-unknown-unknown-sycldevice -aux-triple x86_64-pc-windows-msvc -fsycl-is-device -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE=addrspace(1) '
 // RUN: %clang_cc1 -triple x86_64-pc-windows-msvc -fsycl-is-host -disable-llvm-passes -emit-llvm %s -o - | FileCheck %s '-D$ADDRSPACE='
 
 
 template<typename KN, typename Func>
-[[clang::sycl_entry_point]] void kernel(Func F){
+[[clang::sycl_kernel_entry_point(KN)]] void kernel(Func F){
   F();
 }
 
 template<typename KN, typename Func>
-[[clang::sycl_entry_point]] void kernel2(Func F){
+[[clang::sycl_kernel_entry_point(KN)]] void kernel2(Func F){
   F(1);
 }
 
 template<typename KN, typename Func>
-[[clang::sycl_entry_point]] void kernel3(Func F){
+[[clang::sycl_kernel_entry_point(KN)]] void kernel3(Func F){
   F(1.1);
 }
 



More information about the cfe-commits mailing list