xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGenCXX/apple-kext-linkage.C (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -triple x86_64-apple-darwin10 -fapple-kext -emit-llvm -o - %s | FileCheck %s
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc struct Base {
4*f4a2713aSLionel Sambuc   virtual ~Base();
5*f4a2713aSLionel Sambuc } ;
6*f4a2713aSLionel Sambuc 
7*f4a2713aSLionel Sambuc struct Derived : Base {
deleteDerived8*f4a2713aSLionel Sambuc   void operator delete(void *) { }
9*f4a2713aSLionel Sambuc   Derived();
10*f4a2713aSLionel Sambuc };
11*f4a2713aSLionel Sambuc 
foo()12*f4a2713aSLionel Sambuc void foo() {
13*f4a2713aSLionel Sambuc   Derived d1;			// ok
14*f4a2713aSLionel Sambuc }
15*f4a2713aSLionel Sambuc 
16*f4a2713aSLionel Sambuc // CHECK-LABEL: define internal i32 @_Z1fj(
f(unsigned n)17*f4a2713aSLionel Sambuc inline unsigned f(unsigned n) { return n == 0 ? 0 : n + f(n-1); }
18*f4a2713aSLionel Sambuc 
g(unsigned n)19*f4a2713aSLionel Sambuc unsigned g(unsigned n) { return f(n); }
20*f4a2713aSLionel Sambuc 
21*f4a2713aSLionel Sambuc // rdar://problem/10133200: give explicit instantiations external linkage in kernel mode
22*f4a2713aSLionel Sambuc // CHECK-LABEL: define void @_Z3barIiEvv()
bar()23*f4a2713aSLionel Sambuc template <typename T> void bar() {}
24*f4a2713aSLionel Sambuc template void bar<int>();
25*f4a2713aSLionel Sambuc 
26*f4a2713aSLionel Sambuc // CHECK-LABEL: define internal i32 @_Z5identIiET_S0_(
ident(X x)27*f4a2713aSLionel Sambuc template <typename X> X ident(X x) { return x; }
28*f4a2713aSLionel Sambuc 
foo(int n)29*f4a2713aSLionel Sambuc int foo(int n) { return ident(n); }
30*f4a2713aSLionel Sambuc 
31*f4a2713aSLionel Sambuc // CHECK-LABEL: define internal void @_ZN7DerivedD1Ev(
32*f4a2713aSLionel Sambuc // CHECK-LABEL: define internal void @_ZN7DerivedD0Ev(
33*f4a2713aSLionel Sambuc // CHECK-LABEL: define internal void @_ZN7DeriveddlEPv(
34