fail_out_of_line_decl.carbon 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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. class C {}
  7. // CHECK:STDERR: fail_out_of_line_decl.carbon:[[@LINE+3]]:6: ERROR: Out-of-line declaration requires a declaration in scoped entity.
  8. // CHECK:STDERR: fn C.F() {}
  9. // CHECK:STDERR: ^
  10. fn C.F() {}
  11. // CHECK:STDOUT: --- fail_out_of_line_decl.carbon
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: constants {
  14. // CHECK:STDOUT: %C: type = class_type @C [template]
  15. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  16. // CHECK:STDOUT: %F: type = fn_type @F [template]
  17. // CHECK:STDOUT: %.2: type = tuple_type () [template]
  18. // CHECK:STDOUT: %struct: F = struct_value () [template]
  19. // CHECK:STDOUT: }
  20. // CHECK:STDOUT:
  21. // CHECK:STDOUT: file {
  22. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  23. // CHECK:STDOUT: .Core = %Core
  24. // CHECK:STDOUT: .C = %C.decl
  25. // CHECK:STDOUT: }
  26. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  27. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
  28. // CHECK:STDOUT: %F.decl: F = fn_decl @F [template = constants.%struct] {}
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT:
  31. // CHECK:STDOUT: class @C {
  32. // CHECK:STDOUT: !members:
  33. // CHECK:STDOUT: .Self = constants.%C
  34. // CHECK:STDOUT: .F = file.%F.decl
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT:
  37. // CHECK:STDOUT: fn @F() {
  38. // CHECK:STDOUT: !entry:
  39. // CHECK:STDOUT: return
  40. // CHECK:STDOUT: }
  41. // CHECK:STDOUT: