| Sebastian Redl | 14afaf0 | 2011-04-24 16:27:30 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -emit-llvm -o - -chain-include %s -chain-include %s | FileCheck %s |
| 2 | // CHECK: define linkonce_odr %{{[^ ]+}} @_ZN1AI1BE3getEv | ||||
| 3 | #if !defined(PASS1) | ||||
| 4 | #define PASS1 | ||||
| 5 | |||||
| 6 | template <typename Derived> | ||||
| 7 | struct A { | ||||
| 8 | Derived* get() { return 0; } | ||||
| 9 | }; | ||||
| 10 | |||||
| 11 | struct B : A<B> { | ||||
| 12 | }; | ||||
| 13 | |||||
| 14 | #elif !defined(PASS2) | ||||
| 15 | #define PASS2 | ||||
| 16 | |||||
| 17 | struct C : B { | ||||
| 18 | }; | ||||
| 19 | |||||
| 20 | struct D : C { | ||||
| 21 | void run() { | ||||
| 22 | (void)get(); | ||||
| 23 | } | ||||
| 24 | }; | ||||
| 25 | |||||
| 26 | #else | ||||
| 27 | |||||
| 28 | int main() { | ||||
| 29 | D d; | ||||
| 30 | d.run(); | ||||
| 31 | } | ||||
| 32 | |||||
| 33 | #endif | ||||