diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-08-28 18:42:20 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-08-28 18:42:20 +0000 |
commit | aa1f9f1d50adf294674b74510b62e863b68572bc (patch) | |
tree | a3031a6c8d04c9b9705463eda91eb7fd95865970 /test/Sema | |
parent | 45479c88c8a44c55d27c3bd855273bb318082f37 (diff) | |
download | clang-aa1f9f1d50adf294674b74510b62e863b68572bc.tar.gz |
Fix isIntegerConstantExpr eval of __builtin_offsetof to return result
with correct width.
- PR2728.
Also, fix PR2727 test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@55493 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema')
-rw-r--r-- | test/Sema/PR2727.c | 3 | ||||
-rw-r--r-- | test/Sema/PR2728.c | 9 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/Sema/PR2727.c b/test/Sema/PR2727.c index faf934d947..1b3096f0b5 100644 --- a/test/Sema/PR2727.c +++ b/test/Sema/PR2727.c @@ -1,3 +1,6 @@ +// RUN: clang -verify -fsyntax-only -std=c90 %s && +// RUN: clang -verify -fsyntax-only -std=c99 %s + int f (int x) { // sizeof applied to a type should not delete the type. diff --git a/test/Sema/PR2728.c b/test/Sema/PR2728.c new file mode 100644 index 0000000000..01a3be7b9e --- /dev/null +++ b/test/Sema/PR2728.c @@ -0,0 +1,9 @@ +// RUN: clang -verify -fsyntax-only -std=c90 %s && +// RUN: clang -verify -fsyntax-only -std=c99 %s + +struct s +{ + int a; +}; + +int a[__builtin_offsetof(struct s, a) == 0]; |