11// RUN: %clang_cc1 -fsycl -fsycl-is-device -fsyntax-only -Wno-sycl-strict -verify %s
2+ // expected-no-diagnostics
23extern " C" float sinf (float );
34extern " C" float cosf (float );
45extern " C" float floorf (float );
@@ -8,6 +9,8 @@ extern "C" float rintf(float);
89extern " C" float roundf (float );
910extern " C" float truncf (float );
1011extern " C" float copysignf (float , float );
12+ extern " C" float fminf (float , float );
13+ extern " C" float fmaxf (float , float );
1114extern " C" double sin (double );
1215extern " C" double cos (double );
1316extern " C" double floor (double );
@@ -17,6 +20,8 @@ extern "C" double rint(double);
1720extern " C" double round (double );
1821extern " C" double trunc (double );
1922extern " C" double copysign (double , double );
23+ extern " C" double fmin (double , double );
24+ extern " C" double fmax (double , double );
2025template <typename name, typename Func>
2126__attribute__ ((sycl_kernel)) void kernel(const Func &kernelFunc) {
2227 kernelFunc ();
@@ -26,39 +31,51 @@ int main() {
2631 kernel<class kernel_function >([=]() {
2732 int acc[1 ] = {5 };
2833 acc[0 ] *= 2 ;
29- acc[0 ] += (int )truncf (1 .0f ); // expected-no-diagnostics
30- acc[0 ] += (int )trunc (1.0 ); // expected-no-diagnostics
31- acc[0 ] += (int )roundf (1 .0f ); // expected-no-diagnostics
32- acc[0 ] += (int )round (1.0 ); // expected-no-diagnostics
33- acc[0 ] += (int )rintf (1 .0f ); // expected-no-diagnostics
34- acc[0 ] += (int )rint (1.0 ); // expected-no-diagnostics
35- acc[0 ] += (int )nearbyintf (0 .5f ); // expected-no-diagnostics
36- acc[0 ] += (int )nearbyint (0.5 ); // expected-no-diagnostics
37- acc[0 ] += (int )floorf (0 .5f ); // expected-no-diagnostics
38- acc[0 ] += (int )floor (0.5 ); // expected-no-diagnostics
39- acc[0 ] += (int )copysignf (1 .0f , -0 .5f ); // expected-no-diagnostics
40- acc[0 ] += (int )copysign (1.0 , -0.5 ); // expected-no-diagnostics
41- acc[0 ] += (int )sinf (1 .0f ); // expected-no-diagnostics
42- acc[0 ] += (int )sin (1.0 ); // expected-no-diagnostics
43- acc[0 ] += (int )__builtin_sinf (1 .0f ); // expected-no-diagnostics
44- acc[0 ] += (int )__builtin_sin (1.0 ); // expected-no-diagnostics
45- acc[0 ] += (int )cosf (1 .0f ); // expected-no-diagnostics
46- acc[0 ] += (int )cos (1.0 ); // expected-no-diagnostics
47- acc[0 ] += (int )__builtin_cosf (1 .0f ); // expected-no-diagnostics
48- acc[0 ] += (int )__builtin_cos (1.0 ); // expected-no-diagnostics
49- acc[0 ] += (int )logf (1 .0f ); // expected-no-diagnostics
50- acc[0 ] += (int )log (1.0 ); // expected-no-diagnostics
51- acc[0 ] += (int )__builtin_truncf (1 .0f ); // expected-no-diagnostics
52- acc[0 ] += (int )__builtin_trunc (1.0 ); // expected-no-diagnostics
53- acc[0 ] += (int )__builtin_rintf (1 .0f ); // expected-no-diagnostics
54- acc[0 ] += (int )__builtin_rint (1.0 ); // expected-no-diagnostics
55- acc[0 ] += (int )__builtin_nearbyintf (0 .5f ); // expected-no-diagnostics
56- acc[0 ] += (int )__builtin_nearbyint (0.5 ); // expected-no-diagnostics
57- acc[0 ] += (int )__builtin_floorf (0 .5f ); // expected-no-diagnostics
58- acc[0 ] += (int )__builtin_floor (0.5 ); // expected-no-diagnostics
59- acc[0 ] += (int )__builtin_copysignf (1 .0f , -0 .5f ); // expected-no-diagnostics
60- acc[0 ] += (int )__builtin_logf (1 .0f ); // expected-no-diagnostics
61- acc[0 ] += (int )__builtin_log (1.0 ); // expected-no-diagnostics
34+ acc[0 ] += (int )truncf (1 .0f );
35+ acc[0 ] += (int )trunc (1.0 );
36+ acc[0 ] += (int )roundf (1 .0f );
37+ acc[0 ] += (int )round (1.0 );
38+ acc[0 ] += (int )rintf (1 .0f );
39+ acc[0 ] += (int )rint (1.0 );
40+ acc[0 ] += (int )nearbyintf (0 .5f );
41+ acc[0 ] += (int )nearbyint (0.5 );
42+ acc[0 ] += (int )floorf (0 .5f );
43+ acc[0 ] += (int )floor (0.5 );
44+ acc[0 ] += (int )copysignf (1 .0f , -0 .5f );
45+ acc[0 ] += (int )copysign (1.0 , -0.5 );
46+ acc[0 ] += (int )fminf (1 .5f , 0 .5f );
47+ acc[0 ] += (int )fmin (1.5 , 0.5 );
48+ acc[0 ] += (int )fmaxf (1 .5f , 0 .5f );
49+ acc[0 ] += (int )fmax (1.5 , 0.5 );
50+ acc[0 ] += (int )sinf (1 .0f );
51+ acc[0 ] += (int )sin (1.0 );
52+ acc[0 ] += (int )__builtin_sinf (1 .0f );
53+ acc[0 ] += (int )__builtin_sin (1.0 );
54+ acc[0 ] += (int )cosf (1 .0f );
55+ acc[0 ] += (int )cos (1.0 );
56+ acc[0 ] += (int )__builtin_cosf (1 .0f );
57+ acc[0 ] += (int )__builtin_cos (1.0 );
58+ acc[0 ] += (int )logf (1 .0f );
59+ acc[0 ] += (int )log (1.0 );
60+ acc[0 ] += (int )__builtin_truncf (1 .0f );
61+ acc[0 ] += (int )__builtin_trunc (1.0 );
62+ acc[0 ] += (int )__builtin_rintf (1 .0f );
63+ acc[0 ] += (int )__builtin_rint (1.0 );
64+ acc[0 ] += (int )__builtin_nearbyintf (0 .5f );
65+ acc[0 ] += (int )__builtin_nearbyint (0.5 );
66+ acc[0 ] += (int )__builtin_floorf (0 .5f );
67+ acc[0 ] += (int )__builtin_floor (0.5 );
68+ acc[0 ] += (int )__builtin_copysignf (1 .0f , -0 .5f );
69+ acc[0 ] += (int )__builtin_fminf (1 .5f , 0 .5f );
70+ acc[0 ] += (int )__builtin_fmin (1.5 , 0.5 );
71+ acc[0 ] += (int )__builtin_fmaxf (1 .5f , 0 .5f );
72+ acc[0 ] += (int )__builtin_fmax (1.5 , 0.5 );
73+ acc[0 ] += (int )__builtin_logf (1 .0f );
74+ acc[0 ] += (int )__builtin_log (1.0 );
75+ acc[0 ] += __builtin_isinf (1.0 );
76+ acc[0 ] += __builtin_isfinite (1.0 );
77+ acc[0 ] += __builtin_isnormal (1.0 );
78+ acc[0 ] += __builtin_fpclassify (0 , 1 , 4 , 3 , 2 , 1.0 );
6279 });
6380 return 0 ;
6481}
0 commit comments