[clang] cd0b005 - [clang][Interp][NFC] Add some working _Complex tests

Timm Bäder via cfe-commits cfe-commits at lists.llvm.org
Thu Jan 25 05:22:11 PST 2024


Author: Timm Bäder
Date: 2024-01-25T14:21:59+01:00
New Revision: cd0b0055a730e55f2f14f35172e05dc27642f8ce

URL: https://github.com/llvm/llvm-project/commit/cd0b0055a730e55f2f14f35172e05dc27642f8ce
DIFF: https://github.com/llvm/llvm-project/commit/cd0b0055a730e55f2f14f35172e05dc27642f8ce.diff

LOG: [clang][Interp][NFC] Add some working _Complex tests

Added: 
    

Modified: 
    clang/test/AST/Interp/complex.cpp

Removed: 
    


################################################################################
diff  --git a/clang/test/AST/Interp/complex.cpp b/clang/test/AST/Interp/complex.cpp
index 99c0dd141d0b77..836ea552adac86 100644
--- a/clang/test/AST/Interp/complex.cpp
+++ b/clang/test/AST/Interp/complex.cpp
@@ -8,6 +8,11 @@ constexpr _Complex double z1 = {1.0, 2.0};
 static_assert(__real(z1) == 1.0, "");
 static_assert(__imag(z1) == 2.0, "");
 
+static_assert(&__imag z1 == &__real z1 + 1, "");
+static_assert((*(&__imag z1)) == __imag z1, "");
+static_assert((*(&__real z1)) == __real z1, "");
+
+
 constexpr double setter() {
   _Complex float d = {1.0, 2.0};
 


        


More information about the cfe-commits mailing list