brintos

brintos / llvm-project-archived public Read only

0
0
Text · 912 B · 83d66bc Raw
32 lines · cpp
1// RUN: %clang_cc1 -triple %itanium_abi_triple -emit-llvm %s -o - | FileCheck %s2 3#pragma weak zex4int zex;5// GCC produces a weak symbol for this because it matches mangled names.6// Different c++ ABIs may or may not mangle this, so we produce a strong7// symbol.8// CHECK: @zex = {{(dso_local )?}}global i329 10#pragma weak foo11struct S {  void foo(); };12void S::foo() {}13// CHECK-LABEL: define {{.*}}void @_ZN1S3fooEv(14 15#pragma weak zed16namespace bar {  void zed() {} }17// CHECK-LABEL: define {{.*}}void @_ZN3bar3zedEv(18 19#pragma weak bah20void bah() {}21// CHECK-LABEL: define {{.*}}void @_Z3bahv(22 23#pragma weak baz24extern "C" void baz() {}25// CHECK-LABEL: define weak {{.*}}void @baz(26 27#pragma weak _Z3baxv28void bax() {}29// GCC produces a weak symbol for this one, but it doesn't look like a good30// idea to expose the mangling to the pragma unless we really have to.31// CHECK-LABEL: define {{.*}}void @_Z3baxv(32