For a default visibility external linkage definition, dso_local is set for ELF
-fno-pic/-fpie and COFF and Mach-O. Since default clang -cc1 for ELF is similar
to -fpic ("PIC Level" is not set), this nuance causes unneeded binary format differences.
To make emitted IR similar, ELF -cc1 -fpic will default to -fno-semantic-interposition,
which sets dso_local for default visibility external linkage definitions.
To make this flip smooth and enable future (dso_local as definition default),
this patch replaces (function) `define ` with `define{{.*}} `,
(variable/constant/alias) `= ` with `={{.*}} `, or inserts appropriate `{{.*}} `.
22 lines
513 B
C++
22 lines
513 B
C++
// RUN: %clang_cc1 -emit-llvm %s -o - -triple=ppc64-windows-msvc | FileCheck %s
|
|
|
|
// The purpose of this test is to see that we do something reasonable for
|
|
// architectures where we haven't checked what MSVC does.
|
|
|
|
struct A {
|
|
A() : a(42) {}
|
|
A(const A &o) : a(o.a) {}
|
|
~A() {}
|
|
int a;
|
|
};
|
|
|
|
struct B {
|
|
A foo(A o);
|
|
};
|
|
|
|
A B::foo(A x) {
|
|
return x;
|
|
}
|
|
|
|
// CHECK-LABEL: define{{.*}} void @"?foo@B@@QEAA?AUA@@U2@@Z"(%struct.B* {{[^,]*}} %this, %struct.A* noalias sret(%struct.A) align 4 %agg.result, %struct.A* %x)
|