attr-endian.c revision 624421f98d8fcb8ed8ebc406da41217682159aa8
1// RUN: %clang_cc1 %s -verify -fsyntax-only 2 3int p1 __attribute__((endian(host))); 4int p2 __attribute__((endian(device))); 5 6int p3 __attribute__((endian)); // expected-error {{'endian' attribute requires parameter 1 to be an identifier}} 7int p4 __attribute__((endian("host"))); // expected-error {{'endian' attribute requires parameter 1 to be an identifier}} 8int p5 __attribute__((endian(host, 15))); // expected-error {{'endian' attribute takes one argument}} 9int p6 __attribute__((endian(strange))); // expected-warning {{unknown endian 'strange'}} 10 11void func(void) __attribute__((endian(host))); // expected-warning {{'endian' attribute only applies to variables}} 12