diff options
author | dim <dim@FreeBSD.org> | 2016-01-06 20:02:26 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-01-06 20:02:26 +0000 |
commit | fc74ff5a0792641885551a63d9ddf8cbfdf76e3c (patch) | |
tree | 955a1295c3fd4378a49478ad5835ca21b769417e /test/SemaOpenCL | |
parent | 3176e97f130184ece0e1a21352c8124cc83ff24a (diff) | |
download | FreeBSD-src-fc74ff5a0792641885551a63d9ddf8cbfdf76e3c.zip FreeBSD-src-fc74ff5a0792641885551a63d9ddf8cbfdf76e3c.tar.gz |
Vendor import of clang trunk r256945:
https://llvm.org/svn/llvm-project/cfe/trunk@256945
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r-- | test/SemaOpenCL/cond.cl | 2 | ||||
-rw-r--r-- | test/SemaOpenCL/func_ptr.cl | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/test/SemaOpenCL/cond.cl b/test/SemaOpenCL/cond.cl index 8cc4f1e..60f7056 100644 --- a/test/SemaOpenCL/cond.cl +++ b/test/SemaOpenCL/cond.cl @@ -128,5 +128,5 @@ int foo2(int); unsigned int ntest12(int2 C) { - return (unsigned int)(C ? foo1 : foo2); // expected-error {{taking address of function is not allowed}} + return (unsigned int)(C ? foo1 : foo2); // expected-error {{taking address of function is not allowed}} expected-error {{taking address of function is not allowed}} } diff --git a/test/SemaOpenCL/func_ptr.cl b/test/SemaOpenCL/func_ptr.cl index f21a3d3..abeab73 100644 --- a/test/SemaOpenCL/func_ptr.cl +++ b/test/SemaOpenCL/func_ptr.cl @@ -11,6 +11,9 @@ void bar() foo((void*)foo); // expected-error{{taking address of function is not allowed}} foo(&foo); // expected-error{{taking address of function is not allowed}} + // initializing an array with the address of functions is an error + void* vptrarr[2] = {foo, &foo}; // expected-error{{taking address of function is not allowed}} expected-error{{taking address of function is not allowed}} + // just calling a function is correct foo(0); } |