[clang] 7f2f6ee - clang/OpenCL: Check calling convention in test
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Thu Jan 12 10:39:28 PST 2023
Author: Matt Arsenault
Date: 2023-01-12T13:39:23-05:00
New Revision: 7f2f6eec3ead9c5715c86159919d6df182d1cc4d
URL: https://github.com/llvm/llvm-project/commit/7f2f6eec3ead9c5715c86159919d6df182d1cc4d
DIFF: https://github.com/llvm/llvm-project/commit/7f2f6eec3ead9c5715c86159919d6df182d1cc4d.diff
LOG: clang/OpenCL: Check calling convention in test
update_cc_test_checks misses this, so make sure at least one block
enqueue test manually checks the calling convention for the kernel.
Added:
Modified:
clang/test/CodeGenOpenCL/enqueue-kernel-non-entry-block.cl
Removed:
################################################################################
diff --git a/clang/test/CodeGenOpenCL/enqueue-kernel-non-entry-block.cl b/clang/test/CodeGenOpenCL/enqueue-kernel-non-entry-block.cl
index 1e8917b5324b..625f0660482a 100644
--- a/clang/test/CodeGenOpenCL/enqueue-kernel-non-entry-block.cl
+++ b/clang/test/CodeGenOpenCL/enqueue-kernel-non-entry-block.cl
@@ -1,6 +1,6 @@
// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -emit-llvm -o - -triple amdgcn < %s | FileCheck %s --check-prefixes=COMMON,AMDGPU
-// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -emit-llvm -o - -triple "spir-unknown-unknown" < %s | FileCheck %s --check-prefixes=COMMON,SPIR32
-// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -emit-llvm -o - -triple "spir64-unknown-unknown" < %s | FileCheck %s --check-prefixes=COMMON,SPIR64
+// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -emit-llvm -o - -triple "spir-unknown-unknown" < %s | FileCheck %s --check-prefixes=COMMON,SPIR32,SPIR
+// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -emit-llvm -o - -triple "spir64-unknown-unknown" < %s | FileCheck %s --check-prefixes=COMMON,SPIR64,SPIR
// RUN: %clang_cc1 -cl-std=CL2.0 -O0 -debug-info-kind=limited -gno-column-info -emit-llvm -o - -triple amdgcn < %s | FileCheck %s --check-prefixes=CHECK-DEBUG
// Check that the enqueue_kernel array temporary is in the entry block to avoid
@@ -9,7 +9,9 @@
typedef struct {int a;} ndrange_t;
kernel void test(int i) {
-// COMMON-LABEL: define {{.*}} void @test
+// AMDGPU-LABEL: define {{.*}} amdgpu_kernel void @test
+// SPIR-LABEL: define {{.*}} spir_kernel void @test
+
// COMMON-LABEL: entry:
// AMDGPU: %block_sizes = alloca [1 x i64]
// SPIR32: %block_sizes = alloca [1 x i32]
@@ -25,9 +27,15 @@ kernel void test(int i) {
enqueue_kernel(default_queue, flags, ndrange, ^(local void *a) { }, 32);
}
+// AMDGPU-LABEL: define internal void @__test_block_invoke(
+// SPIR-LABEL: define internal spir_func void @__test_block_invoke(
+
+// AMDGPU-LABEL: define internal amdgpu_kernel void @__test_block_invoke_kernel
+// SPIR-LABEL: define spir_kernel void @__test_block_invoke_kernel
+
// Check that the temporary is scoped to the `if`
// CHECK-DEBUG: ![[TESTFILE:[0-9]+]] = !DIFile(filename: "<stdin>"
// CHECK-DEBUG: ![[TESTSCOPE:[0-9]+]] = distinct !DISubprogram(name: "test", {{.*}} file: ![[TESTFILE]]
-// CHECK-DEBUG: ![[IFSCOPE:[0-9]+]] = distinct !DILexicalBlock(scope: ![[TESTSCOPE]], file: ![[TESTFILE]], line: 24)
-// CHECK-DEBUG: ![[TEMPLOCATION]] = !DILocation(line: 25, scope: ![[IFSCOPE]])
+// CHECK-DEBUG: ![[IFSCOPE:[0-9]+]] = distinct !DILexicalBlock(scope: ![[TESTSCOPE]], file: ![[TESTFILE]], line: 26)
+// CHECK-DEBUG: ![[TEMPLOCATION]] = !DILocation(line: 27, scope: ![[IFSCOPE]])
More information about the cfe-commits
mailing list