| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- // 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_name_not_found.carbon:[[@LINE+3]]:16: ERROR: Name `a` not found.
- // CHECK:STDERR: var b: i32 = a[0];
- // CHECK:STDERR: ^
- var b: i32 = a[0];
- }
- // CHECK:STDOUT: --- fail_name_not_found.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %Main: type = fn_type @Main [template]
- // CHECK:STDOUT: %.1: type = tuple_type () [template]
- // CHECK:STDOUT: %struct: Main = struct_value () [template]
- // CHECK:STDOUT: %.2: i32 = int_literal 0 [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Core = %Core
- // CHECK:STDOUT: .Main = %Main.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Core: <namespace> = namespace [template] {}
- // CHECK:STDOUT: %Main.decl: Main = fn_decl @Main [template = constants.%struct] {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn @Main() {
- // CHECK:STDOUT: !entry:
- // CHECK:STDOUT: %b.var: ref i32 = var b
- // CHECK:STDOUT: %b: ref i32 = bind_name b, %b.var
- // CHECK:STDOUT: %a.ref: <error> = name_ref a, <error> [template = <error>]
- // CHECK:STDOUT: %.loc11: i32 = int_literal 0 [template = constants.%.2]
- // CHECK:STDOUT: assign %b.var, <error>
- // CHECK:STDOUT: return
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
|