diff options
author | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
---|---|---|
committer | rdivacky <rdivacky@FreeBSD.org> | 2010-05-04 16:12:48 +0000 |
commit | 8aaf5818a64e9f7687798852af5945b053c68a54 (patch) | |
tree | d6a70c3518b8dea8be7062438d7e8676820ed17f /test/Sema/offsetof.c | |
parent | 71438373cd57f0d5d8c93bb5cf690844a0fbc9d0 (diff) | |
download | FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.zip FreeBSD-src-8aaf5818a64e9f7687798852af5945b053c68a54.tar.gz |
Update clang to r103004.
Diffstat (limited to 'test/Sema/offsetof.c')
-rw-r--r-- | test/Sema/offsetof.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/Sema/offsetof.c b/test/Sema/offsetof.c index 49d4eb4..5026193 100644 --- a/test/Sema/offsetof.c +++ b/test/Sema/offsetof.c @@ -53,4 +53,15 @@ int x[__builtin_offsetof(union x, x)]; struct incomplete; // expected-note 2 {{forward declaration of 'struct incomplete'}} int test1[__builtin_offsetof(struct incomplete, foo)]; // expected-error {{offsetof of incomplete type 'struct incomplete'}} -int test1[__builtin_offsetof(struct incomplete[10], [4].foo)]; // expected-error {{array has incomplete element type 'struct incomplete'}} +int test2[__builtin_offsetof(struct incomplete[10], [4].foo)]; // expected-error {{array has incomplete element type 'struct incomplete'}} + +// Bitfields +struct has_bitfields { + int i : 7; + int j : 12; // expected-note{{bit-field is declared here}} +}; + +int test3 = __builtin_offsetof(struct has_bitfields, j); // expected-error{{cannot compute offset of bit-field 'j'}} + +typedef struct Array { int array[1]; } Array; +int test4 = __builtin_offsetof(Array, array); |