implicit_imports_empty.carbon 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. // TIP: To test this file alone, run:
  7. // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/no_prelude/implicit_imports_empty.carbon
  10. // --- api_only.carbon
  11. package ApiOnly;
  12. // --- api_only_lib.carbon
  13. package ApiOnly library "[[@TEST_NAME]]";
  14. // --- with_impl.carbon
  15. package WithImpl;
  16. // --- with_impl.impl.carbon
  17. impl package WithImpl;
  18. // --- with_impl_extra.impl.carbon
  19. // Multiple impls are allowed.
  20. impl package WithImpl;
  21. // --- with_impl_lib.carbon
  22. package WithImpl library "[[@TEST_NAME]]";
  23. // --- with_impl_lib.impl.carbon
  24. impl package WithImpl library "[[@TEST_NAME]]";
  25. // --- main.carbon
  26. // --- main_lib.carbon
  27. library "[[@TEST_NAME]]";
  28. // --- main_lib.impl.carbon
  29. impl library "[[@TEST_NAME]]";
  30. // CHECK:STDOUT: --- api_only.carbon
  31. // CHECK:STDOUT:
  32. // CHECK:STDOUT: file {
  33. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: --- api_only_lib.carbon
  37. // CHECK:STDOUT:
  38. // CHECK:STDOUT: file {
  39. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT:
  42. // CHECK:STDOUT: --- with_impl.carbon
  43. // CHECK:STDOUT:
  44. // CHECK:STDOUT: file {
  45. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  46. // CHECK:STDOUT: }
  47. // CHECK:STDOUT:
  48. // CHECK:STDOUT: --- with_impl.impl.carbon
  49. // CHECK:STDOUT:
  50. // CHECK:STDOUT: file {
  51. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  52. // CHECK:STDOUT: %WithImpl.import = import WithImpl
  53. // CHECK:STDOUT: %default.import = import <none>
  54. // CHECK:STDOUT: }
  55. // CHECK:STDOUT:
  56. // CHECK:STDOUT: --- with_impl_extra.impl.carbon
  57. // CHECK:STDOUT:
  58. // CHECK:STDOUT: file {
  59. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  60. // CHECK:STDOUT: %WithImpl.import = import WithImpl
  61. // CHECK:STDOUT: %default.import = import <none>
  62. // CHECK:STDOUT: }
  63. // CHECK:STDOUT:
  64. // CHECK:STDOUT: --- with_impl_lib.carbon
  65. // CHECK:STDOUT:
  66. // CHECK:STDOUT: file {
  67. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  68. // CHECK:STDOUT: }
  69. // CHECK:STDOUT:
  70. // CHECK:STDOUT: --- with_impl_lib.impl.carbon
  71. // CHECK:STDOUT:
  72. // CHECK:STDOUT: file {
  73. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  74. // CHECK:STDOUT: %WithImpl.import = import WithImpl
  75. // CHECK:STDOUT: %default.import = import <none>
  76. // CHECK:STDOUT: }
  77. // CHECK:STDOUT:
  78. // CHECK:STDOUT: --- main.carbon
  79. // CHECK:STDOUT:
  80. // CHECK:STDOUT: file {
  81. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  82. // CHECK:STDOUT: }
  83. // CHECK:STDOUT:
  84. // CHECK:STDOUT: --- main_lib.carbon
  85. // CHECK:STDOUT:
  86. // CHECK:STDOUT: file {
  87. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  88. // CHECK:STDOUT: }
  89. // CHECK:STDOUT:
  90. // CHECK:STDOUT: --- main_lib.impl.carbon
  91. // CHECK:STDOUT:
  92. // CHECK:STDOUT: file {
  93. // CHECK:STDOUT: package: <namespace> = namespace [template] {}
  94. // CHECK:STDOUT: %default.import.loc2_6.1 = import <none>
  95. // CHECK:STDOUT: %default.import.loc2_6.2 = import <none>
  96. // CHECK:STDOUT: }
  97. // CHECK:STDOUT: