-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changed ExpectReturnOnAllPaths() to treat continuation, run and await…
- Loading branch information
1 parent
fb0e8fa
commit 88be617
Showing
3 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
explorer/fuzzing/fuzzer_corpus/770513d3093894a2df74c8efcb4d135f430f45b5.textproto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
compilation_unit { | ||
declarations { | ||
class_declaration { | ||
members { | ||
function { | ||
return_term { | ||
kind: Auto | ||
} | ||
body { | ||
statements { | ||
await_statement { | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
explorer/testdata/experimental_continuation/fail_return_in_continuation.carbon
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
// 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 | ||
// | ||
// RUN: %{not} %{explorer} %s 2>&1 | \ | ||
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s | ||
// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \ | ||
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s | ||
// AUTOUPDATE: %{explorer} %s | ||
|
||
package ExplorerTest api; | ||
|
||
fn Main() -> i32 { | ||
var x: i32 = 0; | ||
__continuation k { | ||
x = x + 1; | ||
// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/experimental_continuation/fail_return_in_continuation.carbon:[[@LINE+1]]: return is not within a function body | ||
return x; | ||
} | ||
} |