2014-01-15 03:35:09 +08:00
|
|
|
// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s
|
2013-02-27 03:13:56 +08:00
|
|
|
|
|
|
|
#pragma weak zex
|
|
|
|
int zex;
|
|
|
|
// GCC produces a weak symbol for this because it matches mangled names.
|
|
|
|
// Different c++ ABIs may or may not mangle this, so we produce a strong
|
|
|
|
// symbol.
|
2018-02-24 03:30:48 +08:00
|
|
|
// CHECK: @zex = {{(dso_local )?}}global i32
|
2013-02-27 03:13:56 +08:00
|
|
|
|
|
|
|
#pragma weak foo
|
|
|
|
struct S { void foo(); };
|
|
|
|
void S::foo() {}
|
2013-12-13 00:07:11 +08:00
|
|
|
// CHECK-LABEL: define {{.*}}void @_ZN1S3fooEv(
|
2013-02-27 03:13:56 +08:00
|
|
|
|
|
|
|
#pragma weak zed
|
|
|
|
namespace bar { void zed() {} }
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK-LABEL: define {{.*}}void @_ZN3bar3zedEv(
|
2013-02-27 03:13:56 +08:00
|
|
|
|
|
|
|
#pragma weak bah
|
|
|
|
void bah() {}
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK-LABEL: define {{.*}}void @_Z3bahv(
|
2013-02-27 03:13:56 +08:00
|
|
|
|
|
|
|
#pragma weak baz
|
|
|
|
extern "C" void baz() {}
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK-LABEL: define weak {{.*}}void @baz(
|
2013-02-27 03:13:56 +08:00
|
|
|
|
|
|
|
#pragma weak _Z3baxv
|
|
|
|
void bax() {}
|
|
|
|
// GCC produces a weak symbol for this one, but it doesn't look like a good
|
|
|
|
// idea to expose the mangling to the pragma unless we really have to.
|
2015-06-30 01:29:50 +08:00
|
|
|
// CHECK-LABEL: define {{.*}}void @_Z3baxv(
|