fail_name_with_import_failure.carbon 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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_name_with_import_failure.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/packages/fail_name_with_import_failure.carbon
  10. // --- fail_implicit.impl.carbon
  11. // CHECK:STDERR: fail_implicit.impl.carbon:[[@LINE+4]]:6: error: corresponding API for 'Implicit' not found [LibraryApiNotFound]
  12. // CHECK:STDERR: impl package Implicit;
  13. // CHECK:STDERR: ^~~~~~~
  14. // CHECK:STDERR:
  15. impl package Implicit;
  16. var a: () = A();
  17. // CHECK:STDOUT: --- fail_implicit.impl.carbon
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: constants {
  20. // CHECK:STDOUT: %empty_tuple.type: type = tuple_type () [template]
  21. // CHECK:STDOUT: }
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT: imports {
  24. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  25. // CHECK:STDOUT: import Core//prelude
  26. // CHECK:STDOUT: import Core//prelude/...
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT: }
  29. // CHECK:STDOUT:
  30. // CHECK:STDOUT: file {
  31. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  32. // CHECK:STDOUT: .Core = imports.%Core
  33. // CHECK:STDOUT: .a = %a
  34. // CHECK:STDOUT: has_error
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT: %default.import = import <none>
  37. // CHECK:STDOUT: %Core.import = import Core
  38. // CHECK:STDOUT: name_binding_decl {
  39. // CHECK:STDOUT: %a.patt: %empty_tuple.type = binding_pattern a
  40. // CHECK:STDOUT: %.loc8_1: %empty_tuple.type = var_pattern %a.patt
  41. // CHECK:STDOUT: }
  42. // CHECK:STDOUT: %a.var: ref %empty_tuple.type = var a
  43. // CHECK:STDOUT: %.loc8_9.1: type = splice_block %.loc8_9.3 [template = constants.%empty_tuple.type] {
  44. // CHECK:STDOUT: %.loc8_9.2: %empty_tuple.type = tuple_literal ()
  45. // CHECK:STDOUT: %.loc8_9.3: type = converted %.loc8_9.2, constants.%empty_tuple.type [template = constants.%empty_tuple.type]
  46. // CHECK:STDOUT: }
  47. // CHECK:STDOUT: %a: ref %empty_tuple.type = bind_name a, %a.var
  48. // CHECK:STDOUT: }
  49. // CHECK:STDOUT:
  50. // CHECK:STDOUT: fn @__global_init() {
  51. // CHECK:STDOUT: !entry:
  52. // CHECK:STDOUT: %A.ref: <error> = name_ref A, <error> [template = <error>]
  53. // CHECK:STDOUT: assign file.%a.var, <error>
  54. // CHECK:STDOUT: return
  55. // CHECK:STDOUT: }
  56. // CHECK:STDOUT: