Skip to content

Commit

Permalink
Add another test case
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Oct 15, 2024
1 parent ff72131 commit 01f003d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions clang/test/AST/ByteCode/builtin-bit-cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,12 @@ namespace simple {
static_assert(check_round_trip<unsigned>((int)0x87654321));
static_assert(check_round_trip<unsigned>((int)0x0C05FEFE));
// static_assert(round_trip<float>((int)0x0C05FEFE));


/// This works in GCC and in the bytecode interpreter, but the current interpreter
/// diagnoses it.
static_assert(__builtin_bit_cast(intptr_t, nullptr) == 0); // ref-error {{not an integral constant expression}} \
// ref-note {{indeterminate value can only initialize an object}}
}

namespace bitint {
Expand Down

0 comments on commit 01f003d

Please sign in to comment.