-
Notifications
You must be signed in to change notification settings - Fork 136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[CIR][CIRGen] Create a new block after break and continue #611
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,22 @@ | ||||||||||||||||
// RUN: %clang_cc1 -std=c++17 -triple x86_64-unknown-linux-gnu -fclangir -emit-cir %s -o %t.cir | ||||||||||||||||
// RUN: FileCheck --input-file=%t.cir %s | ||||||||||||||||
// XFAIL: * | ||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These tests are failing because the insertion point is restored by an InsertionGuard in clangir/clang/lib/CIR/CodeGen/CIRGenStmt.cpp Lines 972 to 978 in 3da10fa
|
||||||||||||||||
|
||||||||||||||||
void unreachable_after_break(int a) { | ||||||||||||||||
switch(a) { | ||||||||||||||||
case 0: | ||||||||||||||||
break; | ||||||||||||||||
break; | ||||||||||||||||
int x = 1; | ||||||||||||||||
} | ||||||||||||||||
} | ||||||||||||||||
|
||||||||||||||||
int unreachable_after_return(int a) { | ||||||||||||||||
switch (a) { | ||||||||||||||||
case 0: | ||||||||||||||||
return 0; | ||||||||||||||||
return 1; | ||||||||||||||||
int x = 1; | ||||||||||||||||
} | ||||||||||||||||
return 2; | ||||||||||||||||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part of code was used for test
shouldCreateBlkForGoto
inclang/test/CIR/CodeGen/goto.cpp
. However, it is unrelated togoto
, but a workaround for the broken code forbreak
. This patch also moves the test toswitch.cpp
and renamed it tounreachable_after_break_1
.