fail_api_not_found.carbon 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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/fail_api_not_found.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_api_not_found.carbon
  10. // --- fail_no_api.impl.carbon
  11. // CHECK:STDERR: fail_no_api.impl.carbon:[[@LINE+4]]:6: ERROR: Corresponding API for 'Foo' not found.
  12. // CHECK:STDERR: impl package Foo;
  13. // CHECK:STDERR: ^~~~~~~
  14. // CHECK:STDERR:
  15. impl package Foo;
  16. // --- fail_no_api_lib.impl.carbon
  17. // CHECK:STDERR: fail_no_api_lib.impl.carbon:[[@LINE+4]]:6: ERROR: Corresponding API for 'Foo//Bar' not found.
  18. // CHECK:STDERR: impl package Foo library "Bar";
  19. // CHECK:STDERR: ^~~~~~~
  20. // CHECK:STDERR:
  21. impl package Foo library "Bar";
  22. // --- fail_no_api_main_lib.impl.carbon
  23. // CHECK:STDERR: fail_no_api_main_lib.impl.carbon:[[@LINE+3]]:6: ERROR: Corresponding API for 'Main//Bar' not found.
  24. // CHECK:STDERR: impl library "Bar";
  25. // CHECK:STDERR: ^~~~~~~
  26. impl library "Bar";
  27. // CHECK:STDOUT: --- fail_no_api.impl.carbon
  28. // CHECK:STDOUT:
  29. // CHECK:STDOUT: file {
  30. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  31. // CHECK:STDOUT: .Core = %Core
  32. // CHECK:STDOUT: has_error
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: --- fail_no_api_lib.impl.carbon
  38. // CHECK:STDOUT:
  39. // CHECK:STDOUT: file {
  40. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  41. // CHECK:STDOUT: .Core = %Core
  42. // CHECK:STDOUT: has_error
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  45. // CHECK:STDOUT: }
  46. // CHECK:STDOUT:
  47. // CHECK:STDOUT: --- fail_no_api_main_lib.impl.carbon
  48. // CHECK:STDOUT:
  49. // CHECK:STDOUT: file {
  50. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  51. // CHECK:STDOUT: .Core = %Core
  52. // CHECK:STDOUT: has_error
  53. // CHECK:STDOUT: }
  54. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  55. // CHECK:STDOUT: }
  56. // CHECK:STDOUT: