blob: 7bc7ae1131596a845a0faa8e0ec38c03ac86bf87 [file] [log] [blame]
Peter Collingbournebf36e252011-02-09 21:12:02 +00001// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3#include "cuda.h"
4
5__global__ void g1(int x) {}
6
7template <typename T> void t1(T arg) {
8 g1<<<arg, arg>>>(1);
9}
10
Peter Collingbourne0423fc62011-02-23 01:53:29 +000011void h1(int x) {}
12int h2(int x) { return 1; }
13
Peter Collingbournebf36e252011-02-09 21:12:02 +000014int main(void) {
15 g1<<<1, 1>>>(42);
16
17 t1(1);
Peter Collingbourne0423fc62011-02-23 01:53:29 +000018
19 h1<<<1, 1>>>(42); // expected-error {{kernel call to non-global function h1}}
20
21 int (*fp)(int) = h2;
22 fp<<<1, 1>>>(42); // expected-error {{must have void return type}}
Peter Collingbournebf36e252011-02-09 21:12:02 +000023}