diff options
author | Egor Churaev <egor.churaev@gmail.com> | 2017-03-21 12:55:55 +0000 |
---|---|---|
committer | Egor Churaev <egor.churaev@gmail.com> | 2017-03-21 12:55:55 +0000 |
commit | 40cf0c36256645a229357c029ef83f6a324c818b (patch) | |
tree | 87440dbacc986ec61e9714c3d33e0a19b083a9ba /test/SemaOpenCL | |
parent | 62fafdbf9ce3f19b233a72f64d5523491d9a7d6c (diff) |
[OpenCL] Added implicit conversion rank for overloading functions with vector data type in OpenCL
Summary: I added a new rank to ImplicitConversionRank enum to resolve the function overload ambiguity with vector types. Rank of scalar types conversion is lower than vector splat. So, we can choose which function should we call. See test for more details.
Reviewers: Anastasia, cfe-commits
Reviewed By: Anastasia
Subscribers: bader, yaxunl
Differential Revision: https://reviews.llvm.org/D30816
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@298366 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r-- | test/SemaOpenCL/overload_addrspace_resolution.cl | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/test/SemaOpenCL/overload_addrspace_resolution.cl b/test/SemaOpenCL/overload_addrspace_resolution.cl deleted file mode 100644 index c7cf5fcb8d..0000000000 --- a/test/SemaOpenCL/overload_addrspace_resolution.cl +++ /dev/null @@ -1,29 +0,0 @@ -// RUN: %clang_cc1 -cl-std=CL2.0 -emit-llvm -o - -triple x86_64-unknown-unknown %s | FileCheck %s - -void __attribute__((overloadable)) foo(global int *a, global int *b); -void __attribute__((overloadable)) foo(generic int *a, generic int *b); -void __attribute__((overloadable)) bar(generic int *global *a, generic int *global *b); -void __attribute__((overloadable)) bar(generic int *generic *a, generic int *generic *b); - -void kernel ker() { - global int *a; - global int *b; - generic int *c; - local int *d; - generic int *generic *gengen; - generic int *local *genloc; - generic int *global *genglob; - // CHECK: call void @_Z3fooPU8CLglobaliS0_(i32* undef, i32* undef) - foo(a, b); - // CHECK: call void @_Z3fooPU9CLgenericiS0_(i32* undef, i32* undef) - foo(b, c); - // CHECK: call void @_Z3fooPU9CLgenericiS0_(i32* undef, i32* undef) - foo(a, d); - - // CHECK: call void @_Z3barPU9CLgenericPU9CLgenericiS2_(i32** undef, i32** undef) - bar(gengen, genloc); - // CHECK: call void @_Z3barPU9CLgenericPU9CLgenericiS2_(i32** undef, i32** undef) - bar(gengen, genglob); - // CHECK: call void @_Z3barPU8CLglobalPU9CLgenericiS2_(i32** undef, i32** undef) - bar(genglob, genglob); -} |