1 // RUN: %clang_cc1 -emit-llvm %s -triple x86_64-apple-darwin9 -o %t
2 struct C {
3 void f();
4 void g(int, ...);
5 };
6
7 // RUN: grep "define void @_ZN1C1fEv" %t | count 1
f()8 void C::f() {
9 }
10
test1()11 void test1() {
12 C c;
13
14 // RUN: grep "call void @_ZN1C1fEv" %t | count 1
15 c.f();
16
17 // RUN: grep "call void (.struct.C\*, i32, ...)\* @_ZN1C1gEiz" %t | count 1
18 c.g(1, 2, 3);
19 }
20
21
22 struct S {
23 // RUN: grep "define linkonce_odr void @_ZN1SC1Ev.*unnamed_addr" %t
SS24 inline S() { }
25 // RUN: grep "define linkonce_odr void @_ZN1SC1Ev.*unnamed_addr" %t
~SS26 inline ~S() { }
27
28
29 // RUN: grep "define linkonce_odr void @_ZN1S9f_inline1Ev" %t
f_inline1S30 void f_inline1() { }
31 // RUN: grep "define linkonce_odr void @_ZN1S9f_inline2Ev" %t
f_inline2S32 inline void f_inline2() { }
33
34 // RUN: grep "define linkonce_odr void @_ZN1S1gEv" %t
gS35 static void g() { }
36
37 static void f();
38 };
39
40 // RUN: grep "define void @_ZN1S1fEv" %t
f()41 void S::f() {
42 }
43
test2()44 void test2() {
45 S s;
46
47 s.f_inline1();
48 s.f_inline2();
49
50 S::g();
51
52 }
53
54 struct T {
55 T operator+(const T&);
56 };
57
test3()58 void test3() {
59 T t1, t2;
60
61 // RUN: grep "call void @_ZN1TplERKS_" %t
62 T result = t1 + t2;
63 }
64