From fe667e8522a6be5f73b2aed1adf4ec92d0470695 Mon Sep 17 00:00:00 2001 From: Anastasia Stulova Date: Tue, 28 Apr 2020 11:49:31 +0100 Subject: [PATCH] [OpenCL] Fixed test for the cast operators. The test had unused variable because it missed to cover case with __constant address space. This change now completes the testing fully. --- clang/test/SemaOpenCLCXX/address-space-castoperators.cl | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/clang/test/SemaOpenCLCXX/address-space-castoperators.cl b/clang/test/SemaOpenCLCXX/address-space-castoperators.cl index d61a9a7..7fd7f72 100644 --- a/clang/test/SemaOpenCLCXX/address-space-castoperators.cl +++ b/clang/test/SemaOpenCLCXX/address-space-castoperators.cl @@ -9,4 +9,9 @@ void nester_ptr() { gengen = static_cast(locgen); //expected-error{{static_cast from '__local int *__generic *' to '__generic int *__generic *' is not allowed}} // CHECK-NOT: AddressSpaceConversion gengen = reinterpret_cast(locgen); //expected-warning{{reinterpret_cast from '__local int *__generic *' to '__generic int *__generic *' changes address space of nested pointers}} + + gengen = const_cast(congen); //expected-error{{const_cast from '__constant int *__generic *' to '__generic int *__generic *' is not allowed}} + gengen = static_cast(congen); //expected-error{{static_cast from '__constant int *__generic *' to '__generic int *__generic *' is not allowed}} +// CHECK-NOT: AddressSpaceConversion + gengen = reinterpret_cast(congen); //expected-warning{{reinterpret_cast from '__constant int *__generic *' to '__generic int *__generic *' changes address space of nested pointers}} } -- 2.7.4