__unaligned is not currently mangled in any way in the Itanium ABI. This causes failures when using -fms-extensions and C++ in targets using Itanium ABI. As suggested by @rsmith the simplest thing to do here is actually mangle the qualifier as a vendor extension. This patch also removes the change done in D31976 and updates its test to the new reality. This fixes https://bugs.llvm.org/show_bug.cgi?id=33080 https://bugs.llvm.org/show_bug.cgi?id=33178 Differential Revision: https://reviews.llvm.org/D33398 llvm-svn: 304523
34 lines
1.2 KiB
C++
34 lines
1.2 KiB
C++
// RUN: %clang_cc1 -triple %itanium_abi_triple -fms-extensions -emit-llvm -o- %s | FileCheck %s
|
|
|
|
void fa(__unaligned struct A *) {}
|
|
// CHECK: define void @_Z2faPU11__unaligned1A(
|
|
|
|
void ga(struct A *, struct A *) {}
|
|
// CHECK: define void @_Z2gaP1AS0_(
|
|
|
|
void gb(__unaligned struct A *, struct A *) {}
|
|
// CHECK: define void @_Z2gbPU11__unaligned1APS_(
|
|
|
|
void gc(struct A *, __unaligned struct A *) {}
|
|
// CHECK: define void @_Z2gcP1APU11__unalignedS_(
|
|
|
|
void gd(__unaligned struct A *, __unaligned struct A *) {}
|
|
// CHECK: define void @_Z2gdPU11__unaligned1AS1_(
|
|
|
|
void hb(__unaligned struct A *, __unaligned const struct A *) {}
|
|
// CHECK: define void @_Z2hbPU11__unaligned1APU11__unalignedKS_(
|
|
|
|
void ja(__unaligned struct A *, __unaligned struct A *__unaligned *, __unaligned struct A *__unaligned *__unaligned *) {}
|
|
// CHECK: define void @_Z2jaPU11__unaligned1APU11__unalignedS1_PU11__unalignedS3_(
|
|
|
|
void jb(__unaligned struct A *, __unaligned struct A **, __unaligned struct A *__unaligned *__unaligned *) {}
|
|
// CHECK: @_Z2jbPU11__unaligned1APS1_PU11__unalignedPU11__unalignedS1_(
|
|
|
|
template <typename T, typename Q>
|
|
void ta(T &, Q *) {}
|
|
|
|
void ia(__unaligned struct A &a) {
|
|
ta(a, &a);
|
|
}
|
|
// CHECK: @_Z2taIU11__unaligned1AS1_EvRT_PT0_(
|