[clang] fe5c719 - Implement post-commit comments for D75685/rG86e0a6c60627
Erich Keane via cfe-commits
cfe-commits at lists.llvm.org
Wed Mar 25 12:25:16 PDT 2020
Author: Erich Keane
Date: 2020-03-25T12:24:56-07:00
New Revision: fe5c719eaf572e23b700e75832ec37a3761b337b
URL: https://github.com/llvm/llvm-project/commit/fe5c719eaf572e23b700e75832ec37a3761b337b
DIFF: https://github.com/llvm/llvm-project/commit/fe5c719eaf572e23b700e75832ec37a3761b337b.diff
LOG: Implement post-commit comments for D75685/rG86e0a6c60627
@Anastasia made a pair of comments on D75685 after it was committed
requesting changes to the test. This patch updates the test based on
her comments.
Added:
Modified:
clang/test/CodeGenOpenCL/pipe_types_mangling.cl
Removed:
################################################################################
diff --git a/clang/test/CodeGenOpenCL/pipe_types_mangling.cl b/clang/test/CodeGenOpenCL/pipe_types_mangling.cl
index 32b3b30759b8..a7439f378b81 100644
--- a/clang/test/CodeGenOpenCL/pipe_types_mangling.cl
+++ b/clang/test/CodeGenOpenCL/pipe_types_mangling.cl
@@ -1,30 +1,32 @@
// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=clc++ -o - %s | FileCheck %s --check-prefixes=LINUX
// RUN: %clang_cc1 -triple x86_64-unknown-windows-pc -emit-llvm -O0 -cl-std=clc++ -o - %s -DWIN| FileCheck %s --check-prefixes=WINDOWS
-// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s --check-prefixes=UNMANGLED,OCLLINUX
-// RUN: %clang_cc1 -triple x86_64-unknown-windows-pc -emit-llvm -O0 -cl-std=CL2.0 -o - %s -DWIN| FileCheck %s --check-prefixes=UNMANGLED,OCLWINDOWS
+// RUN: %clang_cc1 -triple x86_64-unknown-linux-gnu -emit-llvm -O0 -cl-std=CL2.0 -o - %s | FileCheck %s --check-prefixes=LINUX
+// RUN: %clang_cc1 -triple x86_64-unknown-windows-pc -emit-llvm -O0 -cl-std=CL2.0 -o - %s -DWIN| FileCheck %s --check-prefixes=OCLWINDOWS
typedef unsigned char __attribute__((ext_vector_type(3))) uchar3;
typedef int __attribute__((ext_vector_type(4))) int4;
+__attribute__((overloadable))
void test1(read_only pipe int p) {
// LINUX: define void @_Z5test18ocl_pipe
// WINDOWS: define dso_local void @"?test1@@YAXU?$ocl_pipe at H$00 at __clang@@@Z"
-// UNMANGLED: define {{.*}}void @test1(
+// OCLWINDOWS: define dso_local void @"?test1@@$$J0YAXU?$ocl_pipe at H$00 at __clang@@@Z"
}
__attribute__((overloadable))
void test2(write_only pipe float p) {
// LINUX: define void @_Z5test28ocl_pipe
// WINDOWS: define dso_local void @"?test2@@YAXU?$ocl_pipe at M$0A@@__clang@@@Z"
-// Note: overloadable attribute makes OpenCL Linux still mangle this,
-// but we cannot overload on pipe still.
-// OCLLINUX: define void @_Z5test28ocl_pipe
// OCLWINDOWS: define dso_local void @"?test2@@$$J0YAXU?$ocl_pipe at M$0A@@__clang@@@Z"
}
#ifdef WIN
-// SPIR Spec specifies mangling on pipes that doesn't include the element type
-// or write/read. Our Windows mangling does, so make sure this still works.
+// It isn't possible to overload on pipe types in Linux mode
+// because the OCL specification on the Itanium ABI has a specified mangling
+// for the entire class of types, and thus doesn't take element type or read/write
+// into account. Thus, both would result in the same mangling, which is an IR-CodeGen
+// error. Our windows implementation of this mangling doesn't have that problem,
+// so we can test it here.
__attribute__((overloadable))
void test2(read_only pipe int p) {
// WINDOWS: define dso_local void @"?test2@@YAXU?$ocl_pipe at H$00 at __clang@@@Z"
@@ -32,30 +34,32 @@ void test2(read_only pipe int p) {
}
#endif
-
+__attribute__((overloadable))
void test3(read_only pipe const int p) {
// LINUX: define void @_Z5test38ocl_pipe
// WINDOWS: define dso_local void @"?test3@@YAXU?$ocl_pipe@$$CBH$00 at __clang@@@Z"
-// UNMANGLED: define {{.*}}void @test3(
+// OCLWINDOWS: define dso_local void @"?test3@@$$J0YAXU?$ocl_pipe@$$CBH$00 at __clang@@@Z"
}
+__attribute__((overloadable))
void test4(read_only pipe uchar3 p) {
// LINUX: define void @_Z5test48ocl_pipe
// WINDOWS: define dso_local void @"?test4@@YAXU?$ocl_pipe at T?$__vector at E$02 at __clang@@$00 at __clang@@@Z"
-// UNMANGLED: define {{.*}}void @test4(
+// OCLWINDOWS: define dso_local void @"?test4@@$$J0YAXU?$ocl_pipe at T?$__vector at E$02 at __clang@@$00 at __clang@@@Z"
}
+__attribute__((overloadable))
void test5(read_only pipe int4 p) {
// LINUX: define void @_Z5test58ocl_pipe
// WINDOWS: define dso_local void @"?test5@@YAXU?$ocl_pipe at T?$__vector at H$03 at __clang@@$00 at __clang@@@Z"
-// UNMANGLED: define {{.*}}void @test5(
+// OCLWINDOWS: define dso_local void @"?test5@@$$J0YAXU?$ocl_pipe at T?$__vector at H$03 at __clang@@$00 at __clang@@@Z"
}
typedef read_only pipe int MyPipe;
kernel void test6(MyPipe p) {
// LINUX: define spir_kernel void @test6
// WINDOWS: define dso_local spir_kernel void @test6
-// UNMANGLED: define {{.*}}void @test6(
+// OCLWINDOWS: define dso_local spir_kernel void @test6
}
struct Person {
@@ -64,9 +68,10 @@ struct Person {
int ID;
};
+__attribute__((overloadable))
void test_reserved_read_pipe(global struct Person *SDst,
read_only pipe struct Person SPipe) {
// LINUX: define void @_Z23test_reserved_read_pipePU8CLglobal6Person8ocl_pipe
// WINDOWS: define dso_local void @"?test_reserved_read_pipe@@YAXPEAU?$_ASCLglobal@$$CAUPerson@@@__clang@@U?$ocl_pipe at UPerson@@$00 at 2@@Z"
-// UNMANGLED: define {{.*}}void @test_reserved_read_pipe(
+// OCLWINDOWS: define dso_local void @"?test_reserved_read_pipe@@$$J0YAXPEAU?$_ASCLglobal@$$CAUPerson@@@__clang@@U?$ocl_pipe at UPerson@@$00 at 2@@Z"
}
More information about the cfe-commits
mailing list