mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 11:06:07 +00:00

The two operations have acted differently since Clang 8, but were unfortunately mangled the same. The new mangling uses new "vendor extended expression" syntax proposed in https://github.com/itanium-cxx-abi/cxx-abi/issues/112 GCC had the same mangling problem, https://gcc.gnu.org/PR88115, and will hopefully be switching to the same mangling as implemented here. Additionally, fix the mangling of `__uuidof` to use the new extension syntax, instead of its previous nonstandard special-case. Adjusts the demangler accordingly. Differential Revision: https://reviews.llvm.org/D93922
26 lines
1.1 KiB
C++
26 lines
1.1 KiB
C++
// RUN: %clang_cc1 -std=c++11 -Wno-gnu-alignof-expression -emit-llvm %s -o - -triple=%itanium_abi_triple | FileCheck %s --check-prefix=CHECK-NEW
|
|
// RUN: %clang_cc1 -std=c++11 -Wno-gnu-alignof-expression -emit-llvm %s -o - -triple=%itanium_abi_triple -fclang-abi-compat=11 | FileCheck %s --check-prefix=CHECK-OLD
|
|
|
|
// Verify the difference in mangling for alignof and __alignof__ in a new ABI
|
|
// compat mode.
|
|
|
|
template <class T> void f1(decltype(alignof(T))) {}
|
|
template void f1<int>(__SIZE_TYPE__);
|
|
// CHECK-OLD: void @_Z2f1IiEvDTatT_E
|
|
// CHECK-NEW: void @_Z2f1IiEvDTatT_E
|
|
|
|
template <class T> void f2(decltype(__alignof__(T))) {}
|
|
template void f2<int>(__SIZE_TYPE__);
|
|
// CHECK-OLD: void @_Z2f2IiEvDTatT_E
|
|
// CHECK-NEW: void @_Z2f2IiEvDTu11__alignof__T_E
|
|
|
|
template <class T> void f3(decltype(alignof(T(0)))) {}
|
|
template void f3<int>(__SIZE_TYPE__);
|
|
// CHECK-OLD: void @_Z2f3IiEvDTazcvT_Li0EE
|
|
// CHECK-NEW: void @_Z2f3IiEvDTazcvT_Li0EE
|
|
|
|
template <class T> void f4(decltype(__alignof__(T(0)))) {}
|
|
template void f4<int>(__SIZE_TYPE__);
|
|
// CHECK-OLD: void @_Z2f4IiEvDTazcvT_Li0EE
|
|
// CHECK-NEW: void @_Z2f4IiEvDTu11__alignof__XcvT_Li0EEEE
|