clang/test/SemaHLSL/BuiltIns/asfloat-constexpr.hlsl
raw| 1 | // RUN: %clang_cc1 -finclude-default-header -triple dxil-pc-shadermodel6.6-library %s -verify |
| 2 | |
| 3 | // expected-no-diagnostics |
| 4 | |
| 5 | // Because asfloat should be constant evaluated, all the static asserts below |
| 6 | // should work! |
| 7 | void ConstExprTest() { |
| 8 | static_assert(asfloat(0x3f800000) == 1.0f, "One"); |
| 9 | static_assert(asfloat(0x40000000.xxx).y == 2.0f, "Two"); |
| 10 | } |