1
1
// RUN: %clang_cc1 -fsycl -fsycl-is-device -fsyntax-only -Wno-sycl-strict -verify %s
2
+ // expected-no-diagnostics
2
3
extern " C" float sinf (float );
3
4
extern " C" float cosf (float );
4
5
extern " C" float floorf (float );
@@ -8,6 +9,8 @@ extern "C" float rintf(float);
8
9
extern " C" float roundf (float );
9
10
extern " C" float truncf (float );
10
11
extern " C" float copysignf (float , float );
12
+ extern " C" float fminf (float , float );
13
+ extern " C" float fmaxf (float , float );
11
14
extern " C" double sin (double );
12
15
extern " C" double cos (double );
13
16
extern " C" double floor (double );
@@ -17,6 +20,8 @@ extern "C" double rint(double);
17
20
extern " C" double round (double );
18
21
extern " C" double trunc (double );
19
22
extern " C" double copysign (double , double );
23
+ extern " C" double fmin (double , double );
24
+ extern " C" double fmax (double , double );
20
25
template <typename name, typename Func>
21
26
__attribute__ ((sycl_kernel)) void kernel(const Func &kernelFunc) {
22
27
kernelFunc ();
@@ -26,39 +31,51 @@ int main() {
26
31
kernel<class kernel_function >([=]() {
27
32
int acc[1 ] = {5 };
28
33
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 );
62
79
});
63
80
return 0 ;
64
81
}
0 commit comments