13 lines · plain
1// RUN: %clang_cc1 -triple dxil-pc-shadermodel6.3-library -finclude-default-header -Wconversion -fnative-half-type %s -verify2 3static double D = 2.0;4static int I = D; // expected-warning{{implicit conversion turns floating-point number into integer: 'double' to 'int'}}5groupshared float F = I; // expected-warning{{implicit conversion from 'int' to 'float' may lose precision}}6 7export 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}13