error_recovery.carbon 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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/impl/no_prelude/error_recovery.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/no_prelude/error_recovery.carbon
  10. // --- fail_fuzz_crash.carbon
  11. class C {}
  12. interface I {}
  13. // CHECK:STDERR: fail_fuzz_crash.carbon:[[@LINE+4]]:14: error: parameters of generic types must be constant [GenericParamMustBeConstant]
  14. // CHECK:STDERR: impl forall [T: type] C as I { }
  15. // CHECK:STDERR: ^~~~~~~
  16. // CHECK:STDERR:
  17. impl forall [T: type] C as I { }
  18. // CHECK:STDOUT: --- fail_fuzz_crash.carbon
  19. // CHECK:STDOUT:
  20. // CHECK:STDOUT: constants {
  21. // CHECK:STDOUT: %C: type = class_type @C [concrete]
  22. // CHECK:STDOUT: %empty_struct_type: type = struct_type {} [concrete]
  23. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete]
  24. // CHECK:STDOUT: %I.type: type = facet_type <@I> [concrete]
  25. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic]
  26. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [concrete]
  27. // CHECK:STDOUT: }
  28. // CHECK:STDOUT:
  29. // CHECK:STDOUT: file {
  30. // CHECK:STDOUT: package: <namespace> = namespace [concrete] {
  31. // CHECK:STDOUT: .C = %C.decl
  32. // CHECK:STDOUT: .I = %I.decl
  33. // CHECK:STDOUT: }
  34. // CHECK:STDOUT: %C.decl: type = class_decl @C [concrete = constants.%C] {} {}
  35. // CHECK:STDOUT: %I.decl: type = interface_decl @I [concrete = constants.%I.type] {} {}
  36. // CHECK:STDOUT: impl_decl @impl [concrete] {} {
  37. // CHECK:STDOUT: %C.ref: type = name_ref C, file.%C.decl [concrete = constants.%C]
  38. // CHECK:STDOUT: %I.ref: type = name_ref I, file.%I.decl [concrete = constants.%I.type]
  39. // CHECK:STDOUT: }
  40. // CHECK:STDOUT: %impl_witness: <witness> = impl_witness () [concrete = constants.%impl_witness]
  41. // CHECK:STDOUT: }
  42. // CHECK:STDOUT:
  43. // CHECK:STDOUT: interface @I {
  44. // CHECK:STDOUT: %Self: %I.type = bind_symbolic_name Self, 0 [symbolic = constants.%Self]
  45. // CHECK:STDOUT:
  46. // CHECK:STDOUT: !members:
  47. // CHECK:STDOUT: .Self = %Self
  48. // CHECK:STDOUT: witness = ()
  49. // CHECK:STDOUT: }
  50. // CHECK:STDOUT:
  51. // CHECK:STDOUT: impl @impl: %C.ref as %I.ref {
  52. // CHECK:STDOUT: !members:
  53. // CHECK:STDOUT: witness = file.%impl_witness
  54. // CHECK:STDOUT: }
  55. // CHECK:STDOUT:
  56. // CHECK:STDOUT: class @C {
  57. // CHECK:STDOUT: %complete_type: <witness> = complete_type_witness %empty_struct_type [concrete = constants.%complete_type]
  58. // CHECK:STDOUT: complete_type_witness = %complete_type
  59. // CHECK:STDOUT:
  60. // CHECK:STDOUT: !members:
  61. // CHECK:STDOUT: .Self = constants.%C
  62. // CHECK:STDOUT: }
  63. // CHECK:STDOUT: