fail_name_with_import_failure.carbon 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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+3]]:6: ERROR: Corresponding API for 'Implicit' not found.
  12. // CHECK:STDERR: impl package Implicit;
  13. // CHECK:STDERR: ^~~~~~~
  14. impl package Implicit;
  15. var a: () = A();
  16. // CHECK:STDOUT: --- fail_implicit.impl.carbon
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: constants {
  19. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  20. // CHECK:STDOUT: }
  21. // CHECK:STDOUT:
  22. // CHECK:STDOUT: imports {
  23. // CHECK:STDOUT: %Core: <namespace> = namespace file.%Core.import, [template] {
  24. // CHECK:STDOUT: import Core//prelude
  25. // CHECK:STDOUT: import Core//prelude/operators
  26. // CHECK:STDOUT: import Core//prelude/types
  27. // CHECK:STDOUT: import Core//prelude/operators/arithmetic
  28. // CHECK:STDOUT: import Core//prelude/operators/as
  29. // CHECK:STDOUT: import Core//prelude/operators/bitwise
  30. // CHECK:STDOUT: import Core//prelude/operators/comparison
  31. // CHECK:STDOUT: import Core//prelude/types/bool
  32. // CHECK:STDOUT: }
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT:
  35. // CHECK:STDOUT: file {
  36. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  37. // CHECK:STDOUT: .Core = imports.%Core
  38. // CHECK:STDOUT: .a = %a
  39. // CHECK:STDOUT: has_error
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT: %default.import = import <invalid>
  42. // CHECK:STDOUT: %Core.import = import Core
  43. // CHECK:STDOUT: %.loc7_9.1: %.1 = tuple_literal ()
  44. // CHECK:STDOUT: %.loc7_9.2: type = converted %.loc7_9.1, constants.%.1 [template = constants.%.1]
  45. // CHECK:STDOUT: %a.var: ref %.1 = var a
  46. // CHECK:STDOUT: %a: ref %.1 = bind_name a, %a.var
  47. // CHECK:STDOUT: }
  48. // CHECK:STDOUT:
  49. // CHECK:STDOUT: fn @__global_init() {
  50. // CHECK:STDOUT: !entry:
  51. // CHECK:STDOUT: %A.ref: <error> = name_ref A, <error> [template = <error>]
  52. // CHECK:STDOUT: assign file.%a.var, <error>
  53. // CHECK:STDOUT: return
  54. // CHECK:STDOUT: }
  55. // CHECK:STDOUT: