Douglas Gregor | 8fb280c | 2010-08-31 13:31:19 +0000 | [diff] [blame] | 1 | // Test is line- and column-sensitive; see below. |
| 2 | |
| 3 | namespace std { |
| 4 | namespace rel_ops { |
| 5 | void f(); |
| 6 | } |
| 7 | } |
| 8 | |
| 9 | namespace std { |
| 10 | void g(); |
| 11 | } |
| 12 | |
Douglas Gregor | 6931900 | 2010-08-31 23:48:11 +0000 | [diff] [blame] | 13 | namespace std98 = std; |
| 14 | namespace std0x = std98; |
| 15 | |
Douglas Gregor | 0a35bce | 2010-09-01 03:07:18 +0000 | [diff] [blame] | 16 | using namespace std0x; |
Douglas Gregor | 8fb280c | 2010-08-31 13:31:19 +0000 | [diff] [blame] | 17 | |
Douglas Gregor | 7e24256 | 2010-09-01 19:52:22 +0000 | [diff] [blame] | 18 | namespace std { |
| 19 | int g(int); |
| 20 | } |
| 21 | |
| 22 | using std::g; |
| 23 | |
Douglas Gregor | c5ade2e | 2010-09-02 17:35:32 +0000 | [diff] [blame] | 24 | void std::g() { |
| 25 | } |
| 26 | |
| 27 | namespace my_rel_ops = std::rel_ops; |
| 28 | |
Douglas Gregor | 8fb280c | 2010-08-31 13:31:19 +0000 | [diff] [blame] | 29 | // RUN: c-index-test -test-load-source all %s | FileCheck %s |
Abramo Bagnara | acba90f | 2011-03-08 12:38:20 +0000 | [diff] [blame] | 30 | // CHECK: load-namespaces.cpp:3:11: Namespace=std:3:11 (Definition) Extent=[3:1 - 7:2] |
| 31 | // CHECK: load-namespaces.cpp:4:13: Namespace=rel_ops:4:13 (Definition) Extent=[4:3 - 6:4] |
Abramo Bagnara | ff676cb | 2011-03-08 08:55:46 +0000 | [diff] [blame] | 32 | // CHECK: load-namespaces.cpp:5:10: FunctionDecl=f:5:10 Extent=[5:5 - 5:13] |
Abramo Bagnara | acba90f | 2011-03-08 12:38:20 +0000 | [diff] [blame] | 33 | // CHECK: load-namespaces.cpp:9:11: Namespace=std:9:11 (Definition) Extent=[9:1 - 11:2] |
Abramo Bagnara | ff676cb | 2011-03-08 08:55:46 +0000 | [diff] [blame] | 34 | // CHECK: load-namespaces.cpp:10:8: FunctionDecl=g:10:8 Extent=[10:3 - 10:11] |
Douglas Gregor | 8ea5b9d | 2010-09-01 00:08:19 +0000 | [diff] [blame] | 35 | // CHECK: load-namespaces.cpp:13:11: NamespaceAlias=std98:13:11 Extent=[13:1 - 13:22] |
Douglas Gregor | 6931900 | 2010-08-31 23:48:11 +0000 | [diff] [blame] | 36 | // CHECK: load-namespaces.cpp:13:19: NamespaceRef=std:3:11 Extent=[13:19 - 13:22] |
Douglas Gregor | 8ea5b9d | 2010-09-01 00:08:19 +0000 | [diff] [blame] | 37 | // CHECK: load-namespaces.cpp:14:11: NamespaceAlias=std0x:14:11 Extent=[14:1 - 14:24] |
| 38 | // CHECK: load-namespaces.cpp:14:19: NamespaceRef=std98:13:11 Extent=[14:19 - 14:24] |
Douglas Gregor | 0a35bce | 2010-09-01 03:07:18 +0000 | [diff] [blame] | 39 | // CHECK: load-namespaces.cpp:16:17: UsingDirective=:16:17 Extent=[16:1 - 16:22] |
| 40 | // CHECK: load-namespaces.cpp:16:17: NamespaceRef=std0x:14:11 Extent=[16:17 - 16:22] |
Abramo Bagnara | acba90f | 2011-03-08 12:38:20 +0000 | [diff] [blame] | 41 | // CHECK: load-namespaces.cpp:18:11: Namespace=std:18:11 (Definition) Extent=[18:1 - 20:2] |
Abramo Bagnara | ff676cb | 2011-03-08 08:55:46 +0000 | [diff] [blame] | 42 | // CHECK: load-namespaces.cpp:19:7: FunctionDecl=g:19:7 Extent=[19:3 - 19:13] |
Douglas Gregor | 7e24256 | 2010-09-01 19:52:22 +0000 | [diff] [blame] | 43 | // CHECK: load-namespaces.cpp:19:12: ParmDecl=:19:12 (Definition) Extent=[19:9 - 19:13] |
Argyrios Kyrtzidis | 826faa2 | 2010-11-10 05:40:41 +0000 | [diff] [blame] | 44 | // CHECK: load-namespaces.cpp:22:12: UsingDeclaration=g[19:7, 10:8] Extent=[22:1 - 22:13] |
Douglas Gregor | c5ade2e | 2010-09-02 17:35:32 +0000 | [diff] [blame] | 45 | // CHECK: load-namespaces.cpp:22:7: NamespaceRef=std:18:11 Extent=[22:7 - 22:10] |
Abramo Bagnara | ff676cb | 2011-03-08 08:55:46 +0000 | [diff] [blame] | 46 | // CHECK: load-namespaces.cpp:24:11: FunctionDecl=g:24:11 (Definition) Extent=[24:1 - 25:2] |
Douglas Gregor | c5ade2e | 2010-09-02 17:35:32 +0000 | [diff] [blame] | 47 | // CHECK: load-namespaces.cpp:24:6: NamespaceRef=std:18:11 Extent=[24:6 - 24:9] |
| 48 | // CHECK: load-namespaces.cpp:27:11: NamespaceAlias=my_rel_ops:27:11 Extent=[27:1 - 27:36] |
| 49 | // CHECK: load-namespaces.cpp:27:24: NamespaceRef=std:18:11 Extent=[27:24 - 27:27] |
| 50 | // CHECK: load-namespaces.cpp:27:29: NamespaceRef=rel_ops:4:13 Extent=[27:29 - 27:36] |