| 123456789101112131415161718192021222324252627282930313233343536 |
- // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
- // Exceptions. See /LICENSE for license information.
- // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
- //
- // AUTOUPDATE
- fn Main() {
- // CHECK:STDERR: fail_storage_is_literal.carbon:[[@LINE+3]]:10: ERROR: Cannot implicitly convert from `i32` to `type`.
- // CHECK:STDERR: var x: 1 = 1;
- // CHECK:STDERR: ^
- var x: 1 = 1;
- }
- // CHECK:STDOUT: --- fail_storage_is_literal.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %.1: i32 = int_literal 1 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Main = %Main
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Main: <function> = fn_decl @Main [template] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Main() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %.loc11_10: i32 = int_literal 1 [template = constants.%.1]
- // CHECK:STDOUT: %x.var: ref <error> = var x
- // CHECK:STDOUT: %x: ref <error> = bind_name x, %x.var
- // CHECK:STDOUT: %.loc11_14: i32 = int_literal 1 [template = constants.%.1]
- // CHECK:STDOUT: assign %x.var, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|