diff --git a/SYCL/DeviceLib/cmath_test.cpp b/SYCL/DeviceLib/cmath_test.cpp index c702408739..dfcbaa51a3 100644 --- a/SYCL/DeviceLib/cmath_test.cpp +++ b/SYCL/DeviceLib/cmath_test.cpp @@ -1,4 +1,4 @@ -// RUN: %clangxx -fsycl %s -o %t.out +// RUN: %clangxx -fsycl -fno-builtin %s -o %t.out // RUN: %HOST_RUN_PLACEHOLDER %t.out // RUN: %CPU_RUN_PLACEHOLDER %t.out // RUN: %ACC_RUN_PLACEHOLDER %t.out @@ -192,18 +192,31 @@ void device_integer_math_test(s::queue &deviceQueue) { ldiv_t result_l[1]; lldiv_t result_ll[1]; + int result_i2[1]; + long int result_l2[1]; + long long int result_ll2[1]; + { s::buffer buffer1(result_i, s::range<1>{1}); s::buffer buffer2(result_l, s::range<1>{1}); s::buffer buffer3(result_ll, s::range<1>{1}); + s::buffer buffer4(result_i2, s::range<1>{1}); + s::buffer buffer5(result_l2, s::range<1>{1}); + s::buffer buffer6(result_ll2, s::range<1>{1}); deviceQueue.submit([&](s::handler &cgh) { auto res_i_access = buffer1.get_access(cgh); auto res_l_access = buffer2.get_access(cgh); auto res_ll_access = buffer3.get_access(cgh); + auto res_i2_access = buffer4.get_access(cgh); + auto res_l2_access = buffer5.get_access(cgh); + auto res_ll2_access = buffer6.get_access(cgh); cgh.single_task([=]() { res_i_access[0] = std::div(99, 4); res_l_access[0] = std::ldiv(10000, 23); res_ll_access[0] = std::lldiv(200000000, 47); + res_i2_access[0] = std::abs(-111); + res_l2_access[0] = std::labs(10000); + res_ll2_access[0] = std::llabs(-2000000); }); }); } @@ -211,6 +224,9 @@ void device_integer_math_test(s::queue &deviceQueue) { assert(result_i[0].quot == 24 && result_i[0].rem == 3); assert(result_l[0].quot == 434 && result_l[0].rem == 18); assert(result_ll[0].quot == 4255319 && result_ll[0].rem == 7); + assert(result_i2[0] == 111); + assert(result_l2[0] == 10000); + assert(result_ll2[0] == 2000000); } int main() {