-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sync before exiting a cilk_scope with a non-compound statement body
- Loading branch information
1 parent
d752b94
commit 101b84a
Showing
2 changed files
with
31 additions
and
10 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,19 @@ | ||
// RUN: %clang_cc1 -emit-llvm -fopencilk -disable-llvm-passes -O1 -x c %s -o - | FileCheck %s | ||
|
||
extern void bbb(void); | ||
|
||
// CHECK-LABEL: @aaa | ||
int aaa(int argc, char *argv[]) | ||
{ | ||
// CHECK: call token @llvm.tapir.runtime.start() | ||
cilk_scope | ||
for (int i = 0; i < argc; ++i) | ||
// CHECK: detach within | ||
// CHECK: call void @bbb | ||
// CHECK-NEXT: reattach within | ||
// sync must precede runtime end | ||
// CHECK: sync within | ||
// CHECK: call void @llvm.tapir.runtime.end | ||
cilk_spawn { bbb(); } | ||
return 0; | ||
} |