2009-12-16 04:14:24 +08:00
|
|
|
// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
|
2009-12-08 11:56:49 +08:00
|
|
|
|
|
|
|
// Simple key function test
|
|
|
|
struct testa { virtual void a(); };
|
|
|
|
void testa::a() {}
|
|
|
|
|
|
|
|
// Simple key function test
|
|
|
|
struct testb { virtual void a() {} };
|
|
|
|
testb *testbvar = new testb;
|
|
|
|
|
|
|
|
// Key function with out-of-line inline definition
|
|
|
|
struct testc { virtual void a(); };
|
|
|
|
inline void testc::a() {}
|
|
|
|
|
2010-08-03 15:24:12 +08:00
|
|
|
// Functions with inline specifier are not key functions (PR5705)
|
2009-12-08 11:56:49 +08:00
|
|
|
struct testd { inline virtual void a(); };
|
|
|
|
void testd::a() {}
|
|
|
|
|
2010-08-03 15:24:12 +08:00
|
|
|
// Functions with inline specifier are not key functions (PR5705)
|
2009-12-08 11:56:49 +08:00
|
|
|
struct teste { inline virtual void a(); };
|
|
|
|
teste *testevar = new teste;
|
|
|
|
|
|
|
|
// Key functions with namespace (PR5711)
|
|
|
|
namespace {
|
|
|
|
struct testf { virtual void a(); };
|
|
|
|
}
|
|
|
|
void testf::a() {}
|
|
|
|
|
|
|
|
// Key functions with namespace (PR5711)
|
|
|
|
namespace {
|
|
|
|
struct testg { virtual void a(); };
|
|
|
|
}
|
|
|
|
testg *testgvar = new testg;
|
|
|
|
|
2010-05-14 12:08:48 +08:00
|
|
|
struct X0 { virtual ~X0(); };
|
|
|
|
struct X1 : X0 {
|
|
|
|
virtual void f();
|
|
|
|
};
|
|
|
|
|
|
|
|
inline void X1::f() { }
|
|
|
|
|
|
|
|
void use_X1(X1 *x1) { x1->f(); }
|
|
|
|
|
2009-12-08 11:56:49 +08:00
|
|
|
// FIXME: The checks are extremely difficult to get right when the globals
|
|
|
|
// aren't alphabetized
|
2010-05-14 12:08:48 +08:00
|
|
|
// CHECK: @_ZTV2X1 = weak_odr constant
|
2009-12-08 11:56:49 +08:00
|
|
|
// CHECK: @_ZTV5testa = constant [3 x i8*] [i8* null
|
2009-12-08 12:09:14 +08:00
|
|
|
// CHECK: @_ZTV5testc = weak_odr constant [3 x i8*] [i8* null
|
2009-12-08 11:56:49 +08:00
|
|
|
// CHECK: @_ZTVN12_GLOBAL__N_15testgE = internal constant [3 x i8*] [i8* null
|
2010-08-13 07:36:15 +08:00
|
|
|
// CHECK: @_ZTV5teste = weak_odr constant [3 x i8*] [i8* null
|
|
|
|
// CHECK: @_ZTV5testb = weak_odr constant [3 x i8*] [i8* null
|