blob: 5d36e9af195bb2f92bf837299f6762c55f9ed91c [file] [log] [blame]
Charles Davis5a0164d2010-02-10 23:06:52 +00001// RUN: %clang_cc1 -triple i386-apple-darwin10 -fsyntax-only -verify %s
2
John McCalld6b8de02011-01-25 03:51:08 +00003int a __attribute__((force_align_arg_pointer)); // expected-warning{{attribute only applies to functions}}
Charles Davis5a0164d2010-02-10 23:06:52 +00004
5// It doesn't matter where the attribute is located.
6void b(void) __attribute__((force_align_arg_pointer));
7void __attribute__((force_align_arg_pointer)) c(void);
8
9// Functions only have to be declared force_align_arg_pointer once.
10void b(void) {}
11
12// It doesn't matter which declaration has the attribute.
13void d(void);
14void __attribute__((force_align_arg_pointer)) d(void) {}
15
16// Attribute is ignored on function pointer types.
Charles Davisab442162010-02-17 00:44:47 +000017void (__attribute__((force_align_arg_pointer)) *p)();
Charles Davisbeaf5ed2010-02-18 04:39:19 +000018typedef void (__attribute__((__force_align_arg_pointer__)) *p2)();
Charles Davise01c0632010-02-18 04:56:59 +000019// Attribute is also ignored on function typedefs.
20typedef void __attribute__((force_align_arg_pointer)) e(void);
Charles Davis5a0164d2010-02-10 23:06:52 +000021