blob: 91b1d49e2d064378b1c04d99e84b46f9007c68c8 [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);
Peter Collingbourne8591a7f2011-10-02 23:49:15 +000016 g1(42); // expected-error {{call to global function g1 not configured}}
Peter Collingbourne1f240762011-10-02 23:49:29 +000017 g1<<<1>>>(42); // expected-error {{too few execution configuration arguments to kernel function call}}
18 g1<<<1, 1, 0, 0, 0>>>(42); // expected-error {{too many execution configuration arguments to kernel function call}}
Peter Collingbournebf36e252011-02-09 21:12:02 +000019
20 t1(1);
Peter Collingbourne0423fc62011-02-23 01:53:29 +000021
22 h1<<<1, 1>>>(42); // expected-error {{kernel call to non-global function h1}}
23
24 int (*fp)(int) = h2;
25 fp<<<1, 1>>>(42); // expected-error {{must have void return type}}
Peter Collingbournebf36e252011-02-09 21:12:02 +000026}