summaryrefslogtreecommitdiffstats
path: root/test/SemaOpenCL
diff options
context:
space:
mode:
authorJoey Gouly <joey.gouly@arm.com>2013-11-05 12:30:39 +0000
committerJoey Gouly <joey.gouly@arm.com>2013-11-05 12:30:39 +0000
commitc879fe57330faa87ac22f39ec6f37d992db9790f (patch)
tree0a947f29adac70ad79e1c896fae037bd34260410 /test/SemaOpenCL
parenta72009d27cfd80657dfc701d98a6f74c5378cfd4 (diff)
Do not allow functions or kernels called 'main' in OpenCL.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194068 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/SemaOpenCL')
-rw-r--r--test/SemaOpenCL/invalid-kernel.cl8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/SemaOpenCL/invalid-kernel.cl b/test/SemaOpenCL/invalid-kernel.cl
index 3eb2f71aaf..c12bd8414e 100644
--- a/test/SemaOpenCL/invalid-kernel.cl
+++ b/test/SemaOpenCL/invalid-kernel.cl
@@ -5,3 +5,11 @@ kernel void no_ptrptr(global int **i) { } // expected-error{{kernel parameter ca
kernel int bar() { // expected-error {{kernel must have void return type}}
return 6;
}
+
+kernel void main() { // expected-error {{kernel cannot be called 'main'}}
+
+}
+
+int main() { // expected-error {{function cannot be called 'main'}}
+ return 0;
+}