fail_name_with_import_failure.carbon 2.8 KB

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