1// RUN: %clang_cc1 -fsyntax-only -verify %s -pedantic -std=c99 2 3int __attribute__(()) x; 4 5__inline void __attribute__((__always_inline__, __nodebug__)) 6foo(void) { 7} 8 9 10__attribute__(()) y; // expected-warning {{defaults to 'int'}} 11 12// PR2796 13int (__attribute__(()) *z)(long y); 14 15 16void f1(__attribute__(()) int x); 17 18int f2(y, __attribute__(()) x); // expected-error {{expected identifier}} 19 20// This is parsed as a normal argument list (with two args that are implicit 21// int) because the __attribute__ is a declspec. 22void f3(__attribute__(()) x, // expected-warning {{defaults to 'int'}} 23 y); // expected-warning {{defaults to 'int'}} 24 25void f4(__attribute__(())); // expected-error {{expected parameter declarator}} 26 27 28// This is ok, the __attribute__ applies to the pointer. 29int baz(int (__attribute__(()) *x)(long y)); 30 31void g1(void (*f1)(__attribute__(()) int x)); 32void g2(int (*f2)(y, __attribute__(()) x)); // expected-error {{expected identifier}} 33void g3(void (*f3)(__attribute__(()) x, int y)); // expected-warning {{defaults to 'int'}} 34void g4(void (*f4)(__attribute__(()))); // expected-error {{expected parameter declarator}} 35 36 37void (*h1)(void (*f1)(__attribute__(()) int x)); 38void (*h2)(int (*f2)(y, __attribute__(()) x)); // expected-error {{expected identifier}} 39 40void (*h3)(void (*f3)(__attribute__(()) x)); // expected-warning {{defaults to 'int'}} 41void (*h4)(void (*f4)(__attribute__(()))); // expected-error {{expected parameter declarator}} 42 43 44 45// rdar://6131260 46int foo42(void) { 47 int x, __attribute__((unused)) y, z; 48 return 0; 49} 50 51// rdar://6096491 52void __attribute__((noreturn)) d0(void), __attribute__((noreturn)) d1(void); 53 54void d2(void) __attribute__((noreturn)), d3(void) __attribute__((noreturn)); 55 56 57// PR6287 58void __attribute__((returns_twice)) returns_twice_test(); 59 60int aligned(int); 61int __attribute__((vec_type_hint(char, aligned(16) )) missing_rparen_1; // expected-error {{expected ')'}} 62int __attribute__((mode(x aligned(16) )) missing_rparen_2; // expected-error {{expected ')'}} 63int __attribute__((format(printf, 0 aligned(16) )) missing_rparen_3; // expected-error {{expected ')'}} 64