2013-01-29 05:43:46 +08:00
|
|
|
// RUN: %clang_cc1 -emit-llvm -triple x86_64-apple-darwin9 -o - %s | FileCheck %s
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_ZN1C1fEv
|
2009-04-05 04:47:02 +08:00
|
|
|
void C::f() {
|
|
|
|
}
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z5test1v
|
2009-05-13 05:02:27 +08:00
|
|
|
void test1() {
|
2009-04-05 04:47:02 +08:00
|
|
|
C c;
|
2013-01-29 05:43:46 +08:00
|
|
|
|
|
|
|
// CHECK: call void @_ZN1C1fEv
|
2009-04-05 04:47:02 +08:00
|
|
|
c.f();
|
2013-01-29 05:43:46 +08:00
|
|
|
|
2015-04-17 07:25:00 +08:00
|
|
|
// CHECK: call void (%struct.C*, i32, ...) @_ZN1C1gEiz
|
2009-04-09 04:31:57 +08:00
|
|
|
c.g(1, 2, 3);
|
|
|
|
}
|
2009-05-13 05:02:27 +08:00
|
|
|
|
|
|
|
|
|
|
|
struct S {
|
2009-05-13 05:21:08 +08:00
|
|
|
inline S() { }
|
|
|
|
inline ~S() { }
|
2013-01-29 05:43:46 +08:00
|
|
|
|
2009-05-13 05:02:27 +08:00
|
|
|
void f_inline1() { }
|
|
|
|
inline void f_inline2() { }
|
2013-01-29 05:43:46 +08:00
|
|
|
|
2009-05-13 05:02:27 +08:00
|
|
|
static void g() { }
|
2009-05-16 02:35:39 +08:00
|
|
|
static void f();
|
2012-09-29 06:46:07 +08:00
|
|
|
|
|
|
|
virtual void v() {}
|
2009-05-13 05:02:27 +08:00
|
|
|
};
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_ZN1S1fEv
|
2009-05-16 02:35:39 +08:00
|
|
|
void S::f() {
|
|
|
|
}
|
|
|
|
|
2009-05-13 05:02:27 +08:00
|
|
|
void test2() {
|
|
|
|
S s;
|
2013-01-29 05:43:46 +08:00
|
|
|
|
2009-05-13 05:02:27 +08:00
|
|
|
s.f_inline1();
|
|
|
|
s.f_inline2();
|
2013-01-29 05:43:46 +08:00
|
|
|
|
2009-05-13 05:02:27 +08:00
|
|
|
S::g();
|
|
|
|
}
|
2009-05-27 12:18:27 +08:00
|
|
|
|
2013-01-29 05:43:46 +08:00
|
|
|
// S::S()
|
|
|
|
// CHECK: define linkonce_odr void @_ZN1SC1Ev{{.*}} unnamed_addr
|
|
|
|
|
|
|
|
// S::f_inline1()
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define linkonce_odr void @_ZN1S9f_inline1Ev
|
2013-01-29 05:43:46 +08:00
|
|
|
|
|
|
|
// S::f_inline2()
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define linkonce_odr void @_ZN1S9f_inline2Ev
|
2013-01-29 05:43:46 +08:00
|
|
|
|
|
|
|
// S::g()
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define linkonce_odr void @_ZN1S1gEv
|
2013-01-29 05:43:46 +08:00
|
|
|
|
|
|
|
// S::~S()
|
|
|
|
// CHECK: define linkonce_odr void @_ZN1SD1Ev{{.*}} unnamed_addr
|
|
|
|
|
2009-05-27 12:18:27 +08:00
|
|
|
struct T {
|
|
|
|
T operator+(const T&);
|
|
|
|
};
|
|
|
|
|
2013-08-15 14:47:53 +08:00
|
|
|
// CHECK-LABEL: define void @_Z5test3v
|
2009-05-27 12:18:27 +08:00
|
|
|
void test3() {
|
|
|
|
T t1, t2;
|
2013-01-29 05:43:46 +08:00
|
|
|
|
|
|
|
// CHECK: call void @_ZN1TplERKS_
|
2009-05-27 12:18:27 +08:00
|
|
|
T result = t1 + t2;
|
|
|
|
}
|
2013-01-29 05:43:46 +08:00
|
|
|
|
|
|
|
// S::S()
|
|
|
|
// CHECK: define linkonce_odr void @_ZN1SC2Ev{{.*}} unnamed_addr
|
|
|
|
|
|
|
|
// S::v()
|
|
|
|
// CHECK: define linkonce_odr void @_ZN1S1vEv{{.*}}unnamed_addr
|
|
|
|
|
2015-01-22 08:24:57 +08:00
|
|
|
// S::~S()
|
|
|
|
// CHECK: define linkonce_odr void @_ZN1SD2Ev{{.*}} unnamed_addr
|