global_decl_with_init.carbon 1.0 KB

12345678910111213141516171819202122232425262728293031
  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. var x: i32 = 0;
  7. // CHECK:STDOUT: --- global_decl_with_init.carbon
  8. // CHECK:STDOUT:
  9. // CHECK:STDOUT: constants {
  10. // CHECK:STDOUT: %.1: i32 = int_literal 0 [template]
  11. // CHECK:STDOUT: }
  12. // CHECK:STDOUT:
  13. // CHECK:STDOUT: file {
  14. // CHECK:STDOUT: package: <namespace> = namespace [template] {
  15. // CHECK:STDOUT: .Core = %Core
  16. // CHECK:STDOUT: .x = %x
  17. // CHECK:STDOUT: }
  18. // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
  19. // CHECK:STDOUT: %x.var: ref i32 = var x
  20. // CHECK:STDOUT: %x: ref i32 = bind_name x, %x.var
  21. // CHECK:STDOUT: }
  22. // CHECK:STDOUT:
  23. // CHECK:STDOUT: fn @__global_init() {
  24. // CHECK:STDOUT: !entry:
  25. // CHECK:STDOUT: %.loc7: i32 = int_literal 0 [template = constants.%.1]
  26. // CHECK:STDOUT: assign file.%x.var, %.loc7
  27. // CHECK:STDOUT: return
  28. // CHECK:STDOUT: }
  29. // CHECK:STDOUT: