diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2017-12-18 20:11:37 +0000 |
| commit | 461a67fa15370a9ec88f8f8a240bf7c123bb2029 (patch) | |
| tree | 6942083d7d56bba40ec790a453ca58ad3baf6832 /test/SemaOpenCL/invalid-block.cl | |
| parent | 75c3240472ba6ac2669ee72ca67eb72d4e2851fc (diff) | |
Notes
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}} + }; +} |
