decl_with_init.carbon 999 B

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