blob: 1cfeb0c5022d0d9c813325acd9d7da170f99b3d4 [file] [log] [blame]
Daniel Dunbara5728872009-12-15 20:14:24 +00001// RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
Eli Friedman61eab882009-12-08 03:56:49 +00002
3// Simple key function test
4struct testa { virtual void a(); };
5void testa::a() {}
6
7// Simple key function test
8struct testb { virtual void a() {} };
9testb *testbvar = new testb;
10
11// Key function with out-of-line inline definition
12struct testc { virtual void a(); };
13inline void testc::a() {}
14
15// Key functions with inline specifier (PR5705)
16struct testd { inline virtual void a(); };
17void testd::a() {}
18
19// Key functions with inline specifier (PR5705)
20struct teste { inline virtual void a(); };
21teste *testevar = new teste;
22
23// Key functions with namespace (PR5711)
24namespace {
25 struct testf { virtual void a(); };
26}
27void testf::a() {}
28
29// Key functions with namespace (PR5711)
30namespace {
31 struct testg { virtual void a(); };
32}
33testg *testgvar = new testg;
34
Douglas Gregorca4aa372010-05-14 04:08:48 +000035struct X0 { virtual ~X0(); };
36struct X1 : X0 {
37 virtual void f();
38};
39
40inline void X1::f() { }
41
42void use_X1(X1 *x1) { x1->f(); }
43
Eli Friedman61eab882009-12-08 03:56:49 +000044// FIXME: The checks are extremely difficult to get right when the globals
45// aren't alphabetized
Douglas Gregorca4aa372010-05-14 04:08:48 +000046// CHECK: @_ZTV2X1 = weak_odr constant
Eli Friedman61eab882009-12-08 03:56:49 +000047// CHECK: @_ZTV5testa = constant [3 x i8*] [i8* null
Eli Friedman0259ce22009-12-08 04:09:14 +000048// CHECK: @_ZTV5testc = weak_odr constant [3 x i8*] [i8* null
Eli Friedman61eab882009-12-08 03:56:49 +000049// CHECK: @_ZTVN12_GLOBAL__N_15testgE = internal constant [3 x i8*] [i8* null
50// CHECK: @_ZTV5teste = weak_odr constant [3 x i8*] [i8* null
51// CHECK: @_ZTV5testb = weak_odr constant [3 x i8*] [i8* null