diff options
author | Chris Mihelich <cmihelic@google.com> | 2024-06-05 10:23:44 -0700 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2024-06-05 10:24:42 -0700 |
commit | 699fcf35d2f0234e57fc83e3ed625952c3e919b3 (patch) | |
tree | afeabd78ec5beca168c5d2c433f7a3c264745306 /absl/debugging/internal/demangle_test.cc | |
parent | 8322d3abcc155dcb8b18e4a702ecf1f1e19dafe0 (diff) | |
download | abseil-699fcf35d2f0234e57fc83e3ed625952c3e919b3.tar.gz abseil-699fcf35d2f0234e57fc83e3ed625952c3e919b3.tar.bz2 abseil-699fcf35d2f0234e57fc83e3ed625952c3e919b3.zip |
Demangle alignof expressions, at... and az....
PiperOrigin-RevId: 640568425
Change-Id: Id63142ff2e94d7f7ee16367f34a2e4ae81c29b4e
Diffstat (limited to 'absl/debugging/internal/demangle_test.cc')
-rw-r--r-- | absl/debugging/internal/demangle_test.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/absl/debugging/internal/demangle_test.cc b/absl/debugging/internal/demangle_test.cc index 2f2a48a6..a91935f4 100644 --- a/absl/debugging/internal/demangle_test.cc +++ b/absl/debugging/internal/demangle_test.cc @@ -1098,6 +1098,36 @@ TEST(Demangle, ReinterpretCast) { EXPECT_STREQ("f<>()", tmp); } +TEST(Demangle, AlignofType) { + char tmp[80]; + + // Source: + // + // template <class T> T f(T (&a)[alignof(T)]) { return a[0]; } + // template int f<int>(int (&)[alignof(int)]); + // + // Full LLVM demangling of the instantiation of f: + // + // int f<int>(int (&) [alignof (int)]) + EXPECT_TRUE(Demangle("_Z1fIiET_RAatS0__S0_", tmp, sizeof(tmp))); + EXPECT_STREQ("f<>()", tmp); +} + +TEST(Demangle, AlignofExpression) { + char tmp[80]; + + // Source (note that this uses a GNU extension; it is not standard C++): + // + // template <class T> T f(T (&a)[alignof(T{})]) { return a[0]; } + // template int f<int>(int (&)[alignof(int{})]); + // + // Full LLVM demangling of the instantiation of f: + // + // int f<int>(int (&) [alignof (int{})]) + EXPECT_TRUE(Demangle("_Z1fIiET_RAaztlS0_E_S0_", tmp, sizeof(tmp))); + EXPECT_STREQ("f<>()", tmp); +} + TEST(Demangle, ThreadLocalWrappers) { char tmp[80]; |