xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/c-linkage.cpp (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1*0a6a1f1dSLionel Sambuc // RUN: %clang_cc1 -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s
2f4a2713aSLionel Sambuc // pr6644
3f4a2713aSLionel Sambuc 
4f4a2713aSLionel Sambuc extern "C" {
5f4a2713aSLionel Sambuc   namespace N {
6f4a2713aSLionel Sambuc     struct X {
7f4a2713aSLionel Sambuc       virtual void f();
8f4a2713aSLionel Sambuc     };
f()9f4a2713aSLionel Sambuc     void X::f() { }
10f4a2713aSLionel Sambuc   }
11f4a2713aSLionel Sambuc }
12f4a2713aSLionel Sambuc 
13*0a6a1f1dSLionel Sambuc // CHECK-LABEL: define {{.*}}void @_ZN1N1X1fEv
14f4a2713aSLionel Sambuc 
15f4a2713aSLionel Sambuc extern "C" {
test2_f()16f4a2713aSLionel Sambuc   static void test2_f() {
17f4a2713aSLionel Sambuc   }
18f4a2713aSLionel Sambuc   // CHECK-LABEL: define internal void @_Z7test2_fv
test2_f(int x)19f4a2713aSLionel Sambuc   static void test2_f(int x) {
20f4a2713aSLionel Sambuc   }
21f4a2713aSLionel Sambuc   // CHECK-LABEL: define internal void @_Z7test2_fi
test2_use()22f4a2713aSLionel Sambuc   void test2_use() {
23f4a2713aSLionel Sambuc     test2_f();
24f4a2713aSLionel Sambuc     test2_f(42);
25f4a2713aSLionel Sambuc   }
26f4a2713aSLionel Sambuc }
27f4a2713aSLionel Sambuc 
28f4a2713aSLionel Sambuc extern "C" {
29f4a2713aSLionel Sambuc   struct test3_s {
30f4a2713aSLionel Sambuc   };
operator ==(const int & a,const test3_s & b)31f4a2713aSLionel Sambuc   bool operator==(const int& a, const test3_s& b)  {
32f4a2713aSLionel Sambuc   }
33f4a2713aSLionel Sambuc }
34