fail_not_found.carbon 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. fn Main() {
  7. // CHECK:STDERR: fail_not_found.carbon:[[@LINE+3]]:16: ERROR: Name `x` not found.
  8. // CHECK:STDERR: var y: i32 = package.x;
  9. // CHECK:STDERR: ^~~~~~~~~
  10. var y: i32 = package.x;
  11. }
  12. // CHECK:STDOUT: --- fail_not_found.carbon
  13. // CHECK:STDOUT:
  14. // CHECK:STDOUT: constants {
  15. // CHECK:STDOUT: %Main: type = fn_type @Main [template]
  16. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  17. // CHECK:STDOUT: %struct: Main = struct_value () [template]
  18. // CHECK:STDOUT: }
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: file {
  21. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  22. // CHECK:STDOUT: .Core = %Core
  23. // CHECK:STDOUT: .Main = %Main.decl
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  26. // CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct] {}
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT:
  29. // CHECK:STDOUT: fn @Main() {
  30. // CHECK:STDOUT: !entry:
  31. // CHECK:STDOUT: %y.var: ref i32 = var y
  32. // CHECK:STDOUT: %y: ref i32 = bind_name y, %y.var
  33. // CHECK:STDOUT: %package.ref: <namespace> = name_ref package, package [template = package]
  34. // CHECK:STDOUT: %x.ref: <error> = name_ref x, <error> [template = <error>]
  35. // CHECK:STDOUT: assign %y.var, <error>
  36. // CHECK:STDOUT: return
  37. // CHECK:STDOUT: }
  38. // CHECK:STDOUT: