class_obj.carbon 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  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 A {}
  7. var a: A = {};
  8. // CHECK:STDOUT: --- class_obj.carbon
  9. // CHECK:STDOUT:
  10. // CHECK:STDOUT: constants {
  11. // CHECK:STDOUT: %A: type = class_type @A [template]
  12. // CHECK:STDOUT: %.1: type = struct_type {} [template]
  13. // CHECK:STDOUT: %.2: type = tuple_type () [template]
  14. // CHECK:STDOUT: %.3: type = ptr_type {} [template]
  15. // CHECK:STDOUT: %struct: A = struct_value () [template]
  16. // CHECK:STDOUT: }
  17. // CHECK:STDOUT:
  18. // CHECK:STDOUT: file {
  19. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  20. // CHECK:STDOUT: .Core = %Core
  21. // CHECK:STDOUT: .A = %A.decl
  22. // CHECK:STDOUT: .a = %a
  23. // CHECK:STDOUT: }
  24. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  25. // CHECK:STDOUT: %A.decl: type = class_decl @A [template = constants.%A] {}
  26. // CHECK:STDOUT: %A.ref: type = name_ref A, %A.decl [template = constants.%A]
  27. // CHECK:STDOUT: %a.var: ref A = var a
  28. // CHECK:STDOUT: %a: ref A = bind_name a, %a.var
  29. // CHECK:STDOUT: }
  30. // CHECK:STDOUT:
  31. // CHECK:STDOUT: class @A {
  32. // CHECK:STDOUT: !members:
  33. // CHECK:STDOUT: .Self = constants.%A
  34. // CHECK:STDOUT: }
  35. // CHECK:STDOUT:
  36. // CHECK:STDOUT: fn @__global_init() {
  37. // CHECK:STDOUT: !entry:
  38. // CHECK:STDOUT: %.loc8_13.1: {} = struct_literal ()
  39. // CHECK:STDOUT: %.loc8_13.2: init A = class_init (), file.%a.var [template = constants.%struct]
  40. // CHECK:STDOUT: %.loc8_14: init A = converted %.loc8_13.1, %.loc8_13.2 [template = constants.%struct]
  41. // CHECK:STDOUT: assign file.%a.var, %.loc8_14
  42. // CHECK:STDOUT: return
  43. // CHECK:STDOUT: }
  44. // CHECK:STDOUT: