From 01f003d36ede685fa49cbedb648d8261e3bae819 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timm=20B=C3=A4der?= Date: Tue, 15 Oct 2024 09:04:52 +0200 Subject: [PATCH] Add another test case --- clang/test/AST/ByteCode/builtin-bit-cast.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/clang/test/AST/ByteCode/builtin-bit-cast.cpp b/clang/test/AST/ByteCode/builtin-bit-cast.cpp index 0cab0dcc9ad1d1..c8aec8cb7e7933 100644 --- a/clang/test/AST/ByteCode/builtin-bit-cast.cpp +++ b/clang/test/AST/ByteCode/builtin-bit-cast.cpp @@ -102,6 +102,12 @@ namespace simple { static_assert(check_round_trip((int)0x87654321)); static_assert(check_round_trip((int)0x0C05FEFE)); // static_assert(round_trip((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 {