fail_extend_non_interface.carbon 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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/fail_extend_non_interface.carbon
  8. // TIP: To dump output, run:
  9. // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/impl/fail_extend_non_interface.carbon
  10. class C {
  11. // CHECK:STDERR: fail_extend_non_interface.carbon:[[@LINE+3]]:3: ERROR: Semantics TODO: `extending non-interface constraint`.
  12. // CHECK:STDERR: extend impl as i32;
  13. // CHECK:STDERR: ^~~~~~~~~~~~~~~~~~~
  14. extend impl as i32;
  15. }
  16. // CHECK:STDOUT: --- fail_extend_non_interface.carbon
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: constants {
  19. // CHECK:STDOUT: %C: type = class_type @C [template]
  20. // CHECK:STDOUT: %Int32.type: type = fn_type @Int32 [template]
  21. // CHECK:STDOUT: %.1: type = tuple_type () [template]
  22. // CHECK:STDOUT: %Int32: %Int32.type = struct_value () [template]
  23. // CHECK:STDOUT: %.2: type = struct_type {} [template]
  24. // CHECK:STDOUT: }
  25. // CHECK:STDOUT:
  26. // CHECK:STDOUT: file {
  27. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  28. // CHECK:STDOUT: .Core = %Core
  29. // CHECK:STDOUT: .C = %C.decl
  30. // CHECK:STDOUT: }
  31. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  32. // CHECK:STDOUT: %C.decl: type = class_decl @C [template = constants.%C] {}
  33. // CHECK:STDOUT: %import_ref: %Int32.type = import_ref ir3, inst+3, loaded [template = constants.%Int32]
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: impl @impl: %C as i32;
  37. // CHECK:STDOUT:
  38. // CHECK:STDOUT: class @C {
  39. // CHECK:STDOUT: %.loc15_18.1: type = value_of_initializer %int.make_type_32 [template = i32]
  40. // CHECK:STDOUT: %.loc15_18.2: type = converted %int.make_type_32, %.loc15_18.1 [template = i32]
  41. // CHECK:STDOUT: impl_decl @impl {
  42. // CHECK:STDOUT: %int.make_type_32: init type = call constants.%Int32() [template = i32]
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT:
  45. // CHECK:STDOUT: !members:
  46. // CHECK:STDOUT: .Self = constants.%C
  47. // CHECK:STDOUT: has_error
  48. // CHECK:STDOUT: }
  49. // CHECK:STDOUT:
  50. // CHECK:STDOUT: fn @Int32() -> type = "int.make_type_32";
  51. // CHECK:STDOUT: