diff options
Diffstat (limited to 'test/SemaOpenCL/invalid-block.cl')
| -rw-r--r-- | test/SemaOpenCL/invalid-block.cl | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/SemaOpenCL/invalid-block.cl b/test/SemaOpenCL/invalid-block.cl index 89bf03264e13..5d6dc380a37a 100644 --- a/test/SemaOpenCL/invalid-block.cl +++ b/test/SemaOpenCL/invalid-block.cl @@ -81,3 +81,14 @@ kernel void f7() { }; return; } + +// Taking address of a capture is not allowed +int g; +kernel void f8(int a1) { + int a2; + void (^bl)(void) = ^(void) { + &g; //expected-warning{{expression result unused}} + &a1; //expected-error{{taking address of a capture is not allowed}} + &a2; //expected-error{{taking address of a capture is not allowed}} + }; +} |
