| 1 |
// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -Wconversion -fnative-half-type %s -verify |
| 2 |
|
| 3 |
static double D = 2.0; |
| 4 |
static int I = D; // expected-warning{{implicit conversion turns floating-point number into integer: 'double' to 'int'}} |
| 5 |
groupshared float F = I; // expected-warning{{implicit conversion from 'int' to 'float' may lose precision}} |
| 6 |
|
| 7 |
export void fn() { |
| 8 |
half d = I; // expected-warning{{implicit conversion from 'int' to 'half' may lose precision}} |
| 9 |
int i = D; // expected-warning{{implicit conversion turns floating-point number into integer: 'double' to 'int'}} |
| 10 |
int j = F; // expected-warning{{implicit conversion turns floating-point number into integer: 'float' to 'int'}} |
| 11 |
int k = d; // expected-warning{{implicit conversion turns floating-point number into integer: 'half' to 'int'}} |
| 12 |
} |