diff options
Diffstat (limited to 'test/Sema/exprs.c')
-rw-r--r-- | test/Sema/exprs.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/Sema/exprs.c b/test/Sema/exprs.c index 73d73ebe7b..5413757df7 100644 --- a/test/Sema/exprs.c +++ b/test/Sema/exprs.c @@ -45,3 +45,12 @@ int test8(void) { __builtin_choose_expr (0, 42, i) = 10; // expected-warning {{extension used}} return i; } + + +// PR3386 +struct f { int x : 4; float y[]; }; +int test9(struct f *P) { + return __alignof(P->x) + // expected-error {{invalid application of '__alignof' to bitfield}} expected-warning {{extension used}} + __alignof(P->y); // ok. expected-warning {{extension used}} +} + |