llvm-project/clang/test/SemaOpenCLCXX/invalid-kernel.cl
Sven van Haastregt 29d375f5ff [OpenCL][NFC] Improve OpenCL test file naming
Change "negative" into "invalid" and put "invalid" at the beginning of
the file name, following the bulk of the invalid tests in the
SemaOpenCL directory.

Use the "invalid-" prefix only for tests that contain only invalid
constructs.

Drop the "valid" suffix for CodeGen tests, as inputs in this directory
are supposed to be valid anyway.
2021-01-06 14:16:44 +00:00

18 lines
626 B
Common Lisp

// RUN: %clang_cc1 %s -cl-std=clc++ -pedantic -verify -fsyntax-only
struct C {
kernel void m(); //expected-error{{kernel functions cannot be class members}}
};
template <typename T>
kernel void templ(T par) { //expected-error{{kernel functions cannot be used in a template declaration, instantiation or specialization}}
}
template <int>
kernel void bar(int par) { //expected-error{{kernel functions cannot be used in a template declaration, instantiation or specialization}}
}
kernel void foo(int); //expected-note{{previous declaration is here}}
kernel void foo(float); //expected-error{{conflicting types for 'foo'}}