2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm %s -triple x86_64-apple-darwin9 -o %t
|
2009-04-05 04:47:02 +08:00
|
|
|
struct C {
|
|
|
|
void f();
|
2009-04-09 04:31:57 +08:00
|
|
|
void g(int, ...);
|
2009-04-05 04:47:02 +08:00
|
|
|
};
|
|
|
|
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "define void @_ZN1C1fEv" %t | count 1
|
2009-04-05 04:47:02 +08:00
|
|
|
void C::f() {
|
|
|
|
}
|
|
|
|
|
2009-05-13 05:02:27 +08:00
|
|
|
void test1() {
|
2009-04-05 04:47:02 +08:00
|
|
|
C c;
|
|
|
|
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "call void @_ZN1C1fEv" %t | count 1
|
2009-04-05 04:47:02 +08:00
|
|
|
c.f();
|
2009-04-09 04:31:57 +08:00
|
|
|
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "call void (.struct.C\*, i32, ...)\* @_ZN1C1gEiz" %t | count 1
|
2009-04-09 04:31:57 +08:00
|
|
|
c.g(1, 2, 3);
|
|
|
|
}
|
2009-05-13 05:02:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
struct S {
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "define linkonce_odr void @_ZN1SC1Ev" %t
|
2009-05-13 05:21:08 +08:00
|
|
|
inline S() { }
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "define linkonce_odr void @_ZN1SC1Ev" %t
|
2009-05-13 05:21:08 +08:00
|
|
|
inline ~S() { }
|
2009-05-13 05:02:27 +08:00
|
|
|
|
|
|
|
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "define linkonce_odr void @_ZN1S9f_inline1Ev" %t
|
2009-05-13 05:02:27 +08:00
|
|
|
void f_inline1() { }
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "define linkonce_odr void @_ZN1S9f_inline2Ev" %t
|
2009-05-13 05:02:27 +08:00
|
|
|
inline void f_inline2() { }
|
|
|
|
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "define linkonce_odr void @_ZN1S1gEv" %t
|
2009-05-13 05:02:27 +08:00
|
|
|
static void g() { }
|
2009-05-16 02:35:39 +08:00
|
|
|
|
|
|
|
static void f();
|
2009-05-13 05:02:27 +08:00
|
|
|
};
|
|
|
|
|
2009-11-08 09:45:36 +08:00
|
|
|
// RUN: grep "define void @_ZN1S1fEv" %t
|
2009-05-16 02:35:39 +08:00
|
|
|
void S::f() {
|
|
|
|
}
|
|
|
|
|
2009-05-13 05:02:27 +08:00
|
|
|
void test2() {
|
|
|
|
S s;
|
|
|
|
|
|
|
|
s.f_inline1();
|
|
|
|
s.f_inline2();
|
|
|
|
|
|
|
|
S::g();
|
|
|
|
|
|
|
|
}
|
2009-05-27 12:18:27 +08:00
|
|
|
|
|
|
|
struct T {
|
|
|
|
T operator+(const T&);
|
|
|
|
};
|
|
|
|
|
|
|
|
void test3() {
|
|
|
|
T t1, t2;
|
|
|
|
|
2010-07-30 12:02:24 +08:00
|
|
|
// RUN: grep "call void @_ZN1TplERKS_" %t
|
2009-05-27 12:18:27 +08:00
|
|
|
T result = t1 + t2;
|
|
|
|
}
|