From 456bbe553b5b4fcc523875dd507f4a75d529b494 Mon Sep 17 00:00:00 2001 From: Sergey Kopienko Date: Tue, 7 May 2024 18:58:20 +0200 Subject: [PATCH] [tests] Fix test compile errors for C++20 (#1567) --- .../function.objects/bitwise.operations/bit_and.pass.cpp | 3 +++ .../function.objects/bitwise.operations/bit_not.pass.cpp | 3 +++ .../function.objects/bitwise.operations/bit_or.pass.cpp | 3 +++ .../function.objects/bitwise.operations/bit_xor.pass.cpp | 3 +++ .../utilities/function.objects/comparisons/equal_to.pass.cpp | 3 +++ .../utilities/function.objects/comparisons/greater.pass.cpp | 3 +++ .../function.objects/comparisons/greater_equal.pass.cpp | 3 +++ .../utilities/function.objects/comparisons/less.pass.cpp | 3 +++ .../utilities/function.objects/comparisons/less_equal.pass.cpp | 3 +++ .../function.objects/comparisons/not_equal_to.pass.cpp | 3 +++ .../function.objects/logical.operations/logical_and.pass.cpp | 3 +++ .../function.objects/logical.operations/logical_not.pass.cpp | 3 +++ .../function.objects/logical.operations/logical_or.pass.cpp | 3 +++ 13 files changed, 39 insertions(+) diff --git a/test/xpu_api/utilities/function.objects/bitwise.operations/bit_and.pass.cpp b/test/xpu_api/utilities/function.objects/bitwise.operations/bit_and.pass.cpp index d2ba8339901..5b7126525db 100644 --- a/test/xpu_api/utilities/function.objects/bitwise.operations/bit_and.pass.cpp +++ b/test/xpu_api/utilities/function.objects/bitwise.operations/bit_and.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelBitAndTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::bit_and F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (f(0xEA95, 0xEA95) == 0xEA95); ret_access[0] &= (f(0xEA95, 0x58D3) == 0x4891); ret_access[0] &= (f(0x58D3, 0xEA95) == 0x4891); diff --git a/test/xpu_api/utilities/function.objects/bitwise.operations/bit_not.pass.cpp b/test/xpu_api/utilities/function.objects/bitwise.operations/bit_not.pass.cpp index f89338f8b53..786233b116c 100644 --- a/test/xpu_api/utilities/function.objects/bitwise.operations/bit_not.pass.cpp +++ b/test/xpu_api/utilities/function.objects/bitwise.operations/bit_not.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelBitNotTest; @@ -34,8 +35,10 @@ kernel_test() cgh.single_task([=]() { typedef dpl::bit_not F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = ((f(0xEA95) & 0xFFFF) == 0x156A); ret_access[0] &= ((f(0x58D3) & 0xFFFF) == 0xA72C); ret_access[0] &= ((f(0) & 0xFFFF) == 0xFFFF); diff --git a/test/xpu_api/utilities/function.objects/bitwise.operations/bit_or.pass.cpp b/test/xpu_api/utilities/function.objects/bitwise.operations/bit_or.pass.cpp index 3c507388386..363068eb1bd 100644 --- a/test/xpu_api/utilities/function.objects/bitwise.operations/bit_or.pass.cpp +++ b/test/xpu_api/utilities/function.objects/bitwise.operations/bit_or.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelBitOrTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::bit_or F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (f(0xEA95, 0xEA95) == 0xEA95); ret_access[0] &= (f(0xEA95, 0x58D3) == 0xFAD7); ret_access[0] &= (f(0x58D3, 0xEA95) == 0xFAD7); diff --git a/test/xpu_api/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp b/test/xpu_api/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp index 8c17a809322..a3c7fda3464 100644 --- a/test/xpu_api/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp +++ b/test/xpu_api/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelBitXorTest; @@ -35,9 +36,11 @@ kernel_test() { typedef dpl::bit_xor F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (f(0xEA95, 0xEA95) == 0); ret_access[0] &= (f(0xEA95, 0x58D3) == 0xB246); ret_access[0] &= (f(0x58D3, 0xEA95) == 0xB246); diff --git a/test/xpu_api/utilities/function.objects/comparisons/equal_to.pass.cpp b/test/xpu_api/utilities/function.objects/comparisons/equal_to.pass.cpp index 1bfdac9f59e..8098bfeb942 100644 --- a/test/xpu_api/utilities/function.objects/comparisons/equal_to.pass.cpp +++ b/test/xpu_api/utilities/function.objects/comparisons/equal_to.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelEqualToTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::equal_to F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (f(36, 36)); ret_access[0] &= (!f(36, 6)); diff --git a/test/xpu_api/utilities/function.objects/comparisons/greater.pass.cpp b/test/xpu_api/utilities/function.objects/comparisons/greater.pass.cpp index ba74244838b..cd58cb3a981 100644 --- a/test/xpu_api/utilities/function.objects/comparisons/greater.pass.cpp +++ b/test/xpu_api/utilities/function.objects/comparisons/greater.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelGreaterTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::greater F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (!f(36, 36)); ret_access[0] &= (f(36, 6)); ret_access[0] &= (!f(6, 36)); diff --git a/test/xpu_api/utilities/function.objects/comparisons/greater_equal.pass.cpp b/test/xpu_api/utilities/function.objects/comparisons/greater_equal.pass.cpp index 8c21189fc37..553831b5a9f 100644 --- a/test/xpu_api/utilities/function.objects/comparisons/greater_equal.pass.cpp +++ b/test/xpu_api/utilities/function.objects/comparisons/greater_equal.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelGreaterEqualTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::greater_equal F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (f(36, 36)); ret_access[0] &= (f(36, 6)); ret_access[0] &= (!f(6, 36)); diff --git a/test/xpu_api/utilities/function.objects/comparisons/less.pass.cpp b/test/xpu_api/utilities/function.objects/comparisons/less.pass.cpp index b4efdb52557..633830c834d 100644 --- a/test/xpu_api/utilities/function.objects/comparisons/less.pass.cpp +++ b/test/xpu_api/utilities/function.objects/comparisons/less.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelLessTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::less F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (!f(36, 36)); ret_access[0] &= (!f(36, 6)); ret_access[0] &= (f(6, 36)); diff --git a/test/xpu_api/utilities/function.objects/comparisons/less_equal.pass.cpp b/test/xpu_api/utilities/function.objects/comparisons/less_equal.pass.cpp index c59f77bc2da..58bcfd77a2c 100644 --- a/test/xpu_api/utilities/function.objects/comparisons/less_equal.pass.cpp +++ b/test/xpu_api/utilities/function.objects/comparisons/less_equal.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelLessEqualTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::less_equal F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (f(36, 36)); ret_access[0] &= (!f(36, 6)); ret_access[0] &= (f(6, 36)); diff --git a/test/xpu_api/utilities/function.objects/comparisons/not_equal_to.pass.cpp b/test/xpu_api/utilities/function.objects/comparisons/not_equal_to.pass.cpp index 4b46d513f9b..2067234d21e 100644 --- a/test/xpu_api/utilities/function.objects/comparisons/not_equal_to.pass.cpp +++ b/test/xpu_api/utilities/function.objects/comparisons/not_equal_to.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelNotEqualToTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::not_equal_to F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (!f(36, 36)); ret_access[0] &= (f(36, 6)); diff --git a/test/xpu_api/utilities/function.objects/logical.operations/logical_and.pass.cpp b/test/xpu_api/utilities/function.objects/logical.operations/logical_and.pass.cpp index 155e630d99f..ab5b33c583b 100644 --- a/test/xpu_api/utilities/function.objects/logical.operations/logical_and.pass.cpp +++ b/test/xpu_api/utilities/function.objects/logical.operations/logical_and.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelLogicalAndTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::logical_and F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (f(36, 36)); ret_access[0] &= (!f(36, 0)); ret_access[0] &= (!f(0, 36)); diff --git a/test/xpu_api/utilities/function.objects/logical.operations/logical_not.pass.cpp b/test/xpu_api/utilities/function.objects/logical.operations/logical_not.pass.cpp index 8123ac5ac6f..52161f91a9b 100644 --- a/test/xpu_api/utilities/function.objects/logical.operations/logical_not.pass.cpp +++ b/test/xpu_api/utilities/function.objects/logical.operations/logical_not.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelLogicalNotTest; @@ -34,8 +35,10 @@ kernel_test() cgh.single_task([=]() { typedef dpl::logical_not F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (!f(36)); ret_access[0] &= (f(0)); diff --git a/test/xpu_api/utilities/function.objects/logical.operations/logical_or.pass.cpp b/test/xpu_api/utilities/function.objects/logical.operations/logical_or.pass.cpp index a9f79205cbb..088e4f96cee 100644 --- a/test/xpu_api/utilities/function.objects/logical.operations/logical_or.pass.cpp +++ b/test/xpu_api/utilities/function.objects/logical.operations/logical_or.pass.cpp @@ -19,6 +19,7 @@ #include #include "support/utils.h" +#include "support/test_macros.h" class KernelLogicalOrTest; @@ -34,9 +35,11 @@ kernel_test() cgh.single_task([=]() { typedef dpl::logical_or F; const F f = F(); +#if TEST_STD_VER < 20 static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); static_assert(dpl::is_same::value); +#endif // TEST_STD_VER < 20 ret_access[0] = (f(36, 36)); ret_access[0] &= (f(36, 0)); ret_access[0] &= (f(0, 36));