2009-12-16 04:14:24 +08:00
// RUN: %clang_cc1 -verify -fsyntax-only -triple x86_64-apple-darwin9 %s
2009-08-11 03:03:04 +08:00
int x __attribute__ ( ( section (
2013-07-30 09:31:03 +08:00
42 ) ) ) ; // expected-error {{'section' attribute requires a string}}
2009-08-11 03:03:04 +08:00
// rdar://4341926
int y __attribute__ ( ( section (
" sadf " ) ) ) ; // expected-error {{mach-o section specifier requires a segment and section separated by a comma}}
2010-01-13 04:58:53 +08:00
// PR6007
void test ( ) {
2016-11-12 00:51:40 +08:00
__attribute__ ( ( section ( " NEAR,x " ) ) ) int n1 ; // expected-error {{'section' attribute only applies to functions, methods, properties, and global variables}}
2010-01-13 04:58:53 +08:00
__attribute__ ( ( section ( " NEAR,x " ) ) ) static int n2 ; // ok.
2010-04-08 06:58:06 +08:00
}
2012-05-13 10:42:42 +08:00
// pr9356
void __attribute__ ( ( section ( " foo,zed " ) ) ) test2 ( void ) ; // expected-note {{previous attribute is here}}
void __attribute__ ( ( section ( " bar,zed " ) ) ) test2 ( void ) { } // expected-warning {{section does not match previous declaration}}
2013-12-12 09:34:39 +08:00
2016-11-12 00:51:40 +08:00
enum __attribute__ ( ( section ( " NEAR,x " ) ) ) e { one } ; // expected-error {{'section' attribute only applies to functions, methods, properties, and global variables}}