Revert "[clang][Interp][NFC] Add tests for __fp16"

This reverts commit 0691bcb180.

Looks like this breaks builders, e.g.
https://lab.llvm.org/buildbot#builders/231/builds/9790
This commit is contained in:
Timm Bäder 2023-03-23 10:33:03 +01:00
parent 8c10256734
commit 814177e434

View File

@ -78,94 +78,3 @@ namespace compound {
}
static_assert(f2() == __FLT_MAX__, "");
}
namespace FP16 {
constexpr int i = 2;
constexpr __fp16 f = 1.0f;
static_assert(f == 1.0f, "");
constexpr __fp16 f2 = 1u * f;
static_assert(f2 == 1.0f, "");
constexpr __fp16 f3 = 1.5;
constexpr int i3 = f3;
static_assert(i3 == 1, "");
constexpr bool b3 = f3;
static_assert(b3, "");
static_assert(1.0f16 + 3u == 4, "");
static_assert(4.0f16 / 1.0f16 == 4, "");
static_assert(10.0f16 * false == 0, "");
constexpr __fp16 __fp16s[] = {1.0f16, 2.0f16, 3.0f16, 4.0f16};
constexpr __fp16 m = 5.0f16 / 0.0f16; // ref-error {{must be initialized by a constant expression}} \
// ref-note {{division by zero}} \
// expected-error {{must be initialized by a constant expression}} \
// expected-note {{division by zero}}
static_assert(~2.0f16 == 3, ""); // ref-error {{invalid argument type '_Float16' to unary expression}} \
// expected-error {{invalid argument type '_Float16' to unary expression}}
/// Initialized by a double.
constexpr __fp16 df = 0.0;
/// The other way around.
constexpr double fd = 0.0f16;
static_assert(0.0f == -0.0f, "");
const int k = 3 * (1.0f16 / 3.0f16);
static_assert(k == 1, "");
constexpr bool b = 1.0f16;
static_assert(b, "");
constexpr double db = true;
static_assert(db == 1.0f16, "");
constexpr __fp16 fa[] = {1.0f, 2.0, 1, false};
constexpr double da[] = {1.0f, 2.0, 1, false};
constexpr __fp16 fm = __FLT16_MAX__;
constexpr int someInt = fm;
constexpr float SomeFloat = __FLT_MAX__;
constexpr __fp16 halfFloat = SomeFloat;
constexpr float fp16ptr() {
__fp16 f1 = 1.0f16;
__fp16 *f2 = &f1;
*f2 = 3.0;
return f1;
}
static_assert(fp16ptr() == 3.0, "");
namespace compound {
constexpr float f1() {
__fp16 f = 0;
f += 3.0;
f -= 3.0f;
f += 1;
f /= 1;
f /= 1.0;
f *= f;
f *= 2.0;
return f;
}
static_assert(f1() == 2, "");
constexpr float f2() {
__fp16 f = __FLT16_MAX__;
f += 1.0;
return f;
}
static_assert(f2() == __FLT16_MAX__, "");
}
}