fail_name_lookup.carbon 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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/basics/no_prelude/fail_name_lookup.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/basics/no_prelude/fail_name_lookup.carbon
  10. fn Main() {
  11. // CHECK:STDERR: fail_name_lookup.carbon:[[@LINE+4]]:3: error: name `x` not found [NameNotFound]
  12. // CHECK:STDERR: x;
  13. // CHECK:STDERR: ^
  14. // CHECK:STDERR:
  15. x;
  16. }
  17. // CHECK:STDOUT: --- fail_name_lookup.carbon
  18. // CHECK:STDOUT:
  19. // CHECK:STDOUT: constants {
  20. // CHECK:STDOUT: %Main.type: type = fn_type @Main [template]
  21. // CHECK:STDOUT: %Main: %Main.type = struct_value () [template]
  22. // CHECK:STDOUT: }
  23. // CHECK:STDOUT:
  24. // CHECK:STDOUT: file {
  25. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  26. // CHECK:STDOUT: .Main = %Main.decl
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT: %Main.decl: %Main.type = fn_decl @Main [template = constants.%Main] {} {}
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT:
  31. // CHECK:STDOUT: fn @Main() {
  32. // CHECK:STDOUT: !entry:
  33. // CHECK:STDOUT: %x.ref: <error> = name_ref x, <error> [template = <error>]
  34. // CHECK:STDOUT: return
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT: