-
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.
Mark reducer callbacks used when the type is instantiated
- Loading branch information
1 parent
e3137e8
commit b7808e2
Showing
2 changed files
with
22 additions
and
1 deletion.
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,17 @@ | ||
// Bug 154: Spurious "not needed" warnings for reducer callbacks with -Wall. | ||
// RUN: %clang_cc1 %s -x c++ -fopencilk -fsyntax-only -Wall -verify | ||
// expected-no-diagnostics | ||
|
||
static void identity_64(void *p) { *(long *)p = 0; } | ||
static void sum_64(void *l, void *r) { *(long *)l += *(long *)r; } | ||
|
||
template <class T> | ||
T sum_cilk(){ | ||
long _Hyperobject(identity_64, sum_64) sum = 0; | ||
return sum; | ||
} | ||
|
||
long f() { | ||
long total = sum_cilk<long>(); | ||
return total; | ||
} |