forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CGCilk] Fix code generation of unreachable _Cilk_sync statements. Fi…
…xes issue llvm#93.
- Loading branch information
Showing
2 changed files
with
25 additions
and
5 deletions.
There are no files selected for viewing
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
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,18 @@ | ||
// Check that a sync is not inserted when clang recognizes that it is not reachable. | ||
// | ||
// RUN: %clang_cc1 -fopencilk -ftapir=none -triple x86_64-unknown-linux-gnu -std=c++11 -emit-llvm %s -o - | FileCheck %s | ||
int create() { | ||
return 1; | ||
_Cilk_sync; | ||
} | ||
|
||
// CHECK: define dso_local {{.*}}i32 @_Z6createv() | ||
// CHECK: { | ||
// CHECK: ret i32 1 | ||
// CHECK-NOT: sync | ||
// CHECK: } | ||
|
||
int main([[maybe_unused]] int argc, char *argv[]) { | ||
int e = create(); | ||
return 0; | ||
} |