Sema: diagnose kernel calls to non-global functions
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126292 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaCUDA/kernel-call.cu b/test/SemaCUDA/kernel-call.cu
index 6d51695..7bc7ae1 100644
--- a/test/SemaCUDA/kernel-call.cu
+++ b/test/SemaCUDA/kernel-call.cu
@@ -8,8 +8,16 @@
g1<<<arg, arg>>>(1);
}
+void h1(int x) {}
+int h2(int x) { return 1; }
+
int main(void) {
g1<<<1, 1>>>(42);
t1(1);
+
+ h1<<<1, 1>>>(42); // expected-error {{kernel call to non-global function h1}}
+
+ int (*fp)(int) = h2;
+ fp<<<1, 1>>>(42); // expected-error {{must have void return type}}
}