| Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s | 
| Eli Friedman | 61eab88 | 2009-12-08 03:56:49 +0000 | [diff] [blame] | 2 |  | 
 | 3 | // Simple key function test | 
 | 4 | struct testa { virtual void a(); }; | 
 | 5 | void testa::a() {} | 
 | 6 |  | 
 | 7 | // Simple key function test | 
 | 8 | struct testb { virtual void a() {} }; | 
 | 9 | testb *testbvar = new testb; | 
 | 10 |  | 
 | 11 | // Key function with out-of-line inline definition | 
 | 12 | struct testc { virtual void a(); }; | 
 | 13 | inline void testc::a() {} | 
 | 14 |  | 
 | 15 | // Key functions with inline specifier (PR5705) | 
 | 16 | struct testd { inline virtual void a(); }; | 
 | 17 | void testd::a() {} | 
 | 18 |  | 
 | 19 | // Key functions with inline specifier (PR5705) | 
 | 20 | struct teste { inline virtual void a(); }; | 
 | 21 | teste *testevar = new teste; | 
 | 22 |  | 
 | 23 | // Key functions with namespace (PR5711) | 
 | 24 | namespace { | 
 | 25 |   struct testf { virtual void a(); }; | 
 | 26 | } | 
 | 27 | void testf::a() {} | 
 | 28 |  | 
 | 29 | // Key functions with namespace (PR5711) | 
 | 30 | namespace { | 
 | 31 |   struct testg { virtual void a(); }; | 
 | 32 | } | 
 | 33 | testg *testgvar = new testg; | 
 | 34 |  | 
 | 35 | // FIXME: The checks are extremely difficult to get right when the globals | 
 | 36 | // aren't alphabetized | 
 | 37 | // CHECK: @_ZTV5testa = constant [3 x i8*] [i8* null | 
| Eli Friedman | 0259ce2 | 2009-12-08 04:09:14 +0000 | [diff] [blame] | 38 | // CHECK: @_ZTV5testc = weak_odr constant [3 x i8*] [i8* null | 
| Eli Friedman | 61eab88 | 2009-12-08 03:56:49 +0000 | [diff] [blame] | 39 | // CHECK: @_ZTVN12_GLOBAL__N_15testgE = internal constant [3 x i8*] [i8* null | 
 | 40 | // CHECK: @_ZTV5teste = weak_odr constant [3 x i8*] [i8* null | 
 | 41 | // CHECK: @_ZTV5testb = weak_odr constant [3 x i8*] [i8* null | 
 | 42 |  |