fail_out_of_line_decl.carbon 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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: }
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: file {
  19. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  20. // CHECK:STDOUT: .C = %C.decl
  21. // CHECK:STDOUT: }
  22. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
  23. // CHECK:STDOUT: %F: <function> = fn_decl @F [template] {}
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT:
  26. // CHECK:STDOUT: class @C {
  27. // CHECK:STDOUT: !members:
  28. // CHECK:STDOUT: .Self = constants.%C
  29. // CHECK:STDOUT: .F = file.%F
  30. // CHECK:STDOUT: }
  31. // CHECK:STDOUT:
  32. // CHECK:STDOUT: fn @F() {
  33. // CHECK:STDOUT: !entry:
  34. // CHECK:STDOUT: return
  35. // CHECK:STDOUT: }
  36. // CHECK:STDOUT: