diff options
author | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2009-06-02 17:58:47 +0000 |
commit | f27e5a09a0d815b8a4814152954ff87dadfdefc0 (patch) | |
tree | ce7d964cbb5e39695b71481698f10cb099c23d4a /test/Sema/attr-mode.c | |
download | FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.zip FreeBSD-src-f27e5a09a0d815b8a4814152954ff87dadfdefc0.tar.gz |
Import Clang, at r72732.
Diffstat (limited to 'test/Sema/attr-mode.c')
-rw-r--r-- | test/Sema/attr-mode.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/test/Sema/attr-mode.c b/test/Sema/attr-mode.c new file mode 100644 index 0000000..ac411d7 --- /dev/null +++ b/test/Sema/attr-mode.c @@ -0,0 +1,22 @@ +// RUN: clang-cc -fsyntax-only -verify %s + +typedef int i16_1 __attribute((mode(HI))); +int i16_1_test[sizeof(i16_1) == 2 ? 1 : -1]; +typedef int i16_2 __attribute((__mode__(__HI__))); +int i16_2_test[sizeof(i16_1) == 2 ? 1 : -1]; + +typedef float f64 __attribute((mode(DF))); +int f64_test[sizeof(f64) == 8 ? 1 : -1]; + +typedef int invalid_1 __attribute((mode)); // expected-error{{attribute requires unquoted parameter}} +typedef int invalid_2 __attribute((mode())); // expected-error{{attribute requires unquoted parameter}} +typedef int invalid_3 __attribute((mode(II))); // expected-error{{unknown machine mode}} +typedef struct {int i,j,k;} invalid_4 __attribute((mode(SI))); // expected-error{{mode attribute only supported for integer and floating-point types}} +typedef float invalid_5 __attribute((mode(SI))); // expected-error{{type of machine mode does not match type of base type}} + +int **__attribute((mode(QI)))* i32; // expected-error{{mode attribute}} + +typedef _Complex double c32 __attribute((mode(SC))); +int c32_test[sizeof(c32) == 8 ? 1 : -1]; +typedef _Complex float c64 __attribute((mode(DC))); +typedef _Complex float c80 __attribute((mode(XC))); |