18fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor// Test is line- and column-sensitive; see below.
28fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor
38fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregornamespace std {
48fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor  namespace rel_ops {
58fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor    void f();
68fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor  }
78fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor}
88fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor
98fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregornamespace std {
108fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor  void g();
118fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor}
128fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor
136931900f43cea558c6974075256c07728dbfecc6Douglas Gregornamespace std98 = std;
146931900f43cea558c6974075256c07728dbfecc6Douglas Gregornamespace std0x = std98;
156931900f43cea558c6974075256c07728dbfecc6Douglas Gregor
160a35bceb7768fc0be62cb644a4e31d8bfd9fb44aDouglas Gregorusing namespace std0x;
178fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor
187e24256c95afb64b4d5abf201a0f9f0527cb4cf3Douglas Gregornamespace std {
197e24256c95afb64b4d5abf201a0f9f0527cb4cf3Douglas Gregor  int g(int);
207e24256c95afb64b4d5abf201a0f9f0527cb4cf3Douglas Gregor}
217e24256c95afb64b4d5abf201a0f9f0527cb4cf3Douglas Gregor
227e24256c95afb64b4d5abf201a0f9f0527cb4cf3Douglas Gregorusing std::g;
237e24256c95afb64b4d5abf201a0f9f0527cb4cf3Douglas Gregor
24c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregorvoid std::g() {
25c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregor}
26c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregor
27c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregornamespace my_rel_ops = std::rel_ops;
28c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregor
298fb280cbbc8348d4d38f6ed7fa68bb04326814fbDouglas Gregor// RUN: c-index-test -test-load-source all %s | FileCheck %s
30acba90f30876b4140b738f0d3dd0e50724053a96Abramo Bagnara// CHECK: load-namespaces.cpp:3:11: Namespace=std:3:11 (Definition) Extent=[3:1 - 7:2]
31acba90f30876b4140b738f0d3dd0e50724053a96Abramo Bagnara// CHECK: load-namespaces.cpp:4:13: Namespace=rel_ops:4:13 (Definition) Extent=[4:3 - 6:4]
32ff676cb48fe8bf7be2feaa251dc7c5fb15af4730Abramo Bagnara// CHECK: load-namespaces.cpp:5:10: FunctionDecl=f:5:10 Extent=[5:5 - 5:13]
33acba90f30876b4140b738f0d3dd0e50724053a96Abramo Bagnara// CHECK: load-namespaces.cpp:9:11: Namespace=std:9:11 (Definition) Extent=[9:1 - 11:2]
34ff676cb48fe8bf7be2feaa251dc7c5fb15af4730Abramo Bagnara// CHECK: load-namespaces.cpp:10:8: FunctionDecl=g:10:8 Extent=[10:3 - 10:11]
358ea5b9d832455247a15925398fb663d299d33238Douglas Gregor// CHECK: load-namespaces.cpp:13:11: NamespaceAlias=std98:13:11 Extent=[13:1 - 13:22]
366931900f43cea558c6974075256c07728dbfecc6Douglas Gregor// CHECK: load-namespaces.cpp:13:19: NamespaceRef=std:3:11 Extent=[13:19 - 13:22]
378ea5b9d832455247a15925398fb663d299d33238Douglas Gregor// CHECK: load-namespaces.cpp:14:11: NamespaceAlias=std0x:14:11 Extent=[14:1 - 14:24]
388ea5b9d832455247a15925398fb663d299d33238Douglas Gregor// CHECK: load-namespaces.cpp:14:19: NamespaceRef=std98:13:11 Extent=[14:19 - 14:24]
390a35bceb7768fc0be62cb644a4e31d8bfd9fb44aDouglas Gregor// CHECK: load-namespaces.cpp:16:17: UsingDirective=:16:17 Extent=[16:1 - 16:22]
400a35bceb7768fc0be62cb644a4e31d8bfd9fb44aDouglas Gregor// CHECK: load-namespaces.cpp:16:17: NamespaceRef=std0x:14:11 Extent=[16:17 - 16:22]
41acba90f30876b4140b738f0d3dd0e50724053a96Abramo Bagnara// CHECK: load-namespaces.cpp:18:11: Namespace=std:18:11 (Definition) Extent=[18:1 - 20:2]
42ff676cb48fe8bf7be2feaa251dc7c5fb15af4730Abramo Bagnara// CHECK: load-namespaces.cpp:19:7: FunctionDecl=g:19:7 Extent=[19:3 - 19:13]
43651f13cea278ec967336033dd032faef0e9fc2ecStephen Hines// CHECK: load-namespaces.cpp:19:12: ParmDecl=:19:12 (Definition) Extent=[19:9 - 19:12]
44826faa22bae112e01293a58534a40711043cce65Argyrios Kyrtzidis// CHECK: load-namespaces.cpp:22:12: UsingDeclaration=g[19:7, 10:8] Extent=[22:1 - 22:13]
45c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregor// CHECK: load-namespaces.cpp:22:7: NamespaceRef=std:18:11 Extent=[22:7 - 22:10]
46ff676cb48fe8bf7be2feaa251dc7c5fb15af4730Abramo Bagnara// CHECK: load-namespaces.cpp:24:11: FunctionDecl=g:24:11 (Definition) Extent=[24:1 - 25:2]
47c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregor// CHECK: load-namespaces.cpp:24:6: NamespaceRef=std:18:11 Extent=[24:6 - 24:9]
48c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregor// CHECK: load-namespaces.cpp:27:11: NamespaceAlias=my_rel_ops:27:11 Extent=[27:1 - 27:36]
49c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregor// CHECK: load-namespaces.cpp:27:24: NamespaceRef=std:18:11 Extent=[27:24 - 27:27]
50c5ade2e3644a5822df63e442788d68c591ccdc97Douglas Gregor// CHECK: load-namespaces.cpp:27:29: NamespaceRef=rel_ops:4:13 Extent=[27:29 - 27:36]
51