Galina Kistanova | 0ccb31c | 2011-06-03 22:24:54 +0000 | [diff] [blame] | 1 | // REQUIRES: x86-registered-target,x86-64-registered-target |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 2 | // RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -S %s -o %t-64.s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 3 | // RUN: FileCheck -check-prefix LP64 --input-file=%t-64.s %s |
Richard Smith | 762bb9d | 2011-10-13 22:29:44 +0000 | [diff] [blame] | 4 | // RUN: %clang_cc1 -triple i386-apple-darwin -std=c++11 -S %s -o %t-32.s |
Daniel Dunbar | 4fcfde4 | 2009-11-08 01:45:36 +0000 | [diff] [blame] | 5 | // RUN: FileCheck -check-prefix LP32 --input-file=%t-32.s %s |
Douglas Gregor | 72f6d67 | 2009-09-01 21:04:42 +0000 | [diff] [blame] | 6 | |
| 7 | // PR4826 |
| 8 | struct A { |
| 9 | A() { |
| 10 | } |
| 11 | }; |
| 12 | |
| 13 | template<typename T> |
| 14 | struct B { |
| 15 | B(T) {} |
| 16 | |
| 17 | A nodes; |
| 18 | }; |
| 19 | |
Fariborz Jahanian | cf1b9c7 | 2009-09-02 23:02:57 +0000 | [diff] [blame] | 20 | |
| 21 | // PR4853 |
| 22 | template <typename T> class List { |
| 23 | public: |
Mike Stump | 1eb4433 | 2009-09-09 15:08:12 +0000 | [diff] [blame] | 24 | List(){ } // List<BinomialNode<int>*>::List() remains undefined. |
Fariborz Jahanian | 34374e6 | 2009-09-03 23:18:17 +0000 | [diff] [blame] | 25 | ~List() {} |
Fariborz Jahanian | cf1b9c7 | 2009-09-02 23:02:57 +0000 | [diff] [blame] | 26 | }; |
| 27 | |
Fariborz Jahanian | 9d43620 | 2009-09-03 21:32:41 +0000 | [diff] [blame] | 28 | template <typename T> class Node { |
| 29 | int i; |
| 30 | public: |
| 31 | Node(){ } // Node<BinomialNode<int>*>::Node() remains undefined. |
Fariborz Jahanian | 34374e6 | 2009-09-03 23:18:17 +0000 | [diff] [blame] | 32 | ~Node() {} |
Fariborz Jahanian | 9d43620 | 2009-09-03 21:32:41 +0000 | [diff] [blame] | 33 | }; |
| 34 | |
| 35 | |
| 36 | template<typename T> class BinomialNode : Node<BinomialNode<T>*> { |
Fariborz Jahanian | cf1b9c7 | 2009-09-02 23:02:57 +0000 | [diff] [blame] | 37 | public: |
| 38 | BinomialNode(T value) {} |
| 39 | List<BinomialNode<T>*> nodes; |
| 40 | }; |
| 41 | |
Douglas Gregor | 72f6d67 | 2009-09-01 21:04:42 +0000 | [diff] [blame] | 42 | int main() { |
| 43 | B<int> *n = new B<int>(4); |
Fariborz Jahanian | cf1b9c7 | 2009-09-02 23:02:57 +0000 | [diff] [blame] | 44 | BinomialNode<int> *node = new BinomialNode<int>(1); |
Fariborz Jahanian | 34374e6 | 2009-09-03 23:18:17 +0000 | [diff] [blame] | 45 | delete node; |
Douglas Gregor | 72f6d67 | 2009-09-01 21:04:42 +0000 | [diff] [blame] | 46 | } |
Fariborz Jahanian | cf1b9c7 | 2009-09-02 23:02:57 +0000 | [diff] [blame] | 47 | |
Anders Carlsson | c997d42 | 2010-01-02 01:01:18 +0000 | [diff] [blame] | 48 | // CHECK-LP64: __ZN4NodeIP12BinomialNodeIiEEC2Ev: |
Fariborz Jahanian | cf1b9c7 | 2009-09-02 23:02:57 +0000 | [diff] [blame] | 49 | // CHECK-LP64: __ZN4ListIP12BinomialNodeIiEEC1Ev: |
Eli Friedman | 3453147 | 2009-12-15 03:22:41 +0000 | [diff] [blame] | 50 | // CHECK-LP64: __ZN4ListIP12BinomialNodeIiEED1Ev: |
Fariborz Jahanian | cf1b9c7 | 2009-09-02 23:02:57 +0000 | [diff] [blame] | 51 | |
Anders Carlsson | c997d42 | 2010-01-02 01:01:18 +0000 | [diff] [blame] | 52 | // CHECK-LP32: __ZN4NodeIP12BinomialNodeIiEEC2Ev: |
Fariborz Jahanian | 9d43620 | 2009-09-03 21:32:41 +0000 | [diff] [blame] | 53 | // CHECK-LP32: __ZN4ListIP12BinomialNodeIiEEC1Ev: |
Eli Friedman | 3453147 | 2009-12-15 03:22:41 +0000 | [diff] [blame] | 54 | // CHECK-LP32: __ZN4ListIP12BinomialNodeIiEED1Ev: |