Fix shadowing.carbon to test shadowing behavior. (#872)

This commit is contained in:
Geoff Romer
2021-10-05 16:08:15 -07:00
committed by GitHub
parent 823251efee
commit d5eb9a72f9
@@ -2,14 +2,12 @@
// Exceptions. See /LICENSE for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
// RUN: not executable_semantics %s 2>&1 | \
// RUN: executable_semantics %s 2>&1 | \
// RUN: FileCheck --match-full-lines --allow-unused-prefixes=false %s
// RUN: not executable_semantics --trace %s 2>&1 | \
// RUN: executable_semantics --trace %s 2>&1 | \
// RUN: FileCheck --match-full-lines --allow-unused-prefixes %s
// AUTOUPDATE: executable_semantics %s
// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/global_variable/shadowing.carbon:21: type error in return
// CHECK: expected: ()
// CHECK: actual: i32
// CHECK: result: 0
package ExecutableSemanticsTest api;
@@ -17,7 +15,7 @@ package ExecutableSemanticsTest api;
var x: i32 = 1;
fn identity(x: i32) {
fn identity(x: i32) -> i32 {
return x;
}