From d5eb9a72f9223425f416a787d74b30a7929926e6 Mon Sep 17 00:00:00 2001 From: Geoff Romer Date: Tue, 5 Oct 2021 16:08:15 -0700 Subject: [PATCH] Fix shadowing.carbon to test shadowing behavior. (#872) --- .../testdata/global_variable/shadowing.carbon | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/executable_semantics/testdata/global_variable/shadowing.carbon b/executable_semantics/testdata/global_variable/shadowing.carbon index 761e949d77ef..be66317f4eb8 100644 --- a/executable_semantics/testdata/global_variable/shadowing.carbon +++ b/executable_semantics/testdata/global_variable/shadowing.carbon @@ -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; }