xref: /llvm-project/clang/test/SemaCUDA/noinline.cu (revision c7ba568f40b2d6cbae781223529f63063785b0cf)
1 // RUN: %clang_cc1 -fsyntax-only -verify=cuda %s
2 // RUN: %clang_cc1 -fsyntax-only -verify=pedantic -pedantic %s
3 // RUN: %clang_cc1 -fsyntax-only -verify=cpp -x c++ %s
4 
5 // cuda-no-diagnostics
6 
fun1()7 __noinline__ void fun1() { } // cpp-error {{unknown type name '__noinline__'}}
8 
fun2()9 __attribute__((noinline)) void fun2() { }
fun3()10 __attribute__((__noinline__)) void fun3() { }
fun4()11 [[gnu::__noinline__]] void fun4() { }
12 
13 #define __noinline__ __attribute__((__noinline__))
fun5()14 __noinline__ void fun5() {}
15 
16 #undef __noinline__
17 #10 "cuda.h" 3 // pedantic-warning {{this style of line directive is a GNU extension}}
18 #define __noinline__ __attribute__((__noinline__))
fun6()19 __noinline__ void fun6() {}
20