[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / Sema / attr-function-return.c
blobc6fe88b821e35f9effdd9d6600ee6ee5844c6cc5
1 // RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -verify %s
3 __attribute__((function_return("keep"))) void x(void) {}
5 // expected-warning@+1 {{'function_return' attribute argument not supported: thunk}}
6 __attribute__((function_return("thunk"))) void y(void) {}
8 // expected-warning@+1 {{'function_return' attribute argument not supported: thunk-inline}}
9 __attribute__((function_return("thunk-inline"))) void z(void) {}
11 __attribute__((function_return("thunk-extern"))) void w(void) {}
13 // expected-warning@+1 {{'function_return' attribute argument not supported: invalid}}
14 __attribute__((function_return("invalid"))) void v(void) {}
16 // expected-error@+1 {{'function_return' attribute requires a string}}
17 __attribute__((function_return(5))) void a(void) {}
19 // expected-error@+1 {{'function_return' attribute takes one argument}}
20 __attribute__((function_return)) void b(void) {}
22 // expected-warning@+1 {{'function_return' attribute only applies to functions}}
23 __attribute__((function_return)) int c;