diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2014-11-14 21:41:07 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2014-11-14 21:41:07 +0000 |
commit | dc12b367bc175ad5af56f4701a2ffb43a18db779 (patch) | |
tree | 71225dcb531f8f5a7d96ffeef02f8ffd1ee6c9b7 /clang/test/CodeGen/complex.c | |
parent | 71aa1a9355d80ac3c9579a1277f07fd7b2a609f2 (diff) | |
download | bcm5719-llvm-dc12b367bc175ad5af56f4701a2ffb43a18db779.tar.gz bcm5719-llvm-dc12b367bc175ad5af56f4701a2ffb43a18db779.zip |
Follow-up to D6217
Summary:
Ok, here is somewhat addition to D6217 aiming to preserve old darwin behavior wrt the typedefed types. The actual change to SemaChecking turned out to be pretty gross, in particular:
1. We need to extract the typedef'ed type for proper diagnostics
2. We need to walk over paren expressions as well
Reviewers: chandlerc, rsmith
Reviewed By: rsmith
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D6256
llvm-svn: 222044
Diffstat (limited to 'clang/test/CodeGen/complex.c')
-rw-r--r-- | clang/test/CodeGen/complex.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/clang/test/CodeGen/complex.c b/clang/test/CodeGen/complex.c index 206db253caa..1c0e7cb2ee9 100644 --- a/clang/test/CodeGen/complex.c +++ b/clang/test/CodeGen/complex.c @@ -98,3 +98,19 @@ void t8() { const _Complex double test9const = 0; _Complex double test9func() { return test9const; } + +// D6217 +void t91() { + // Check for proper type promotion of conditional expression + char c[(int)(sizeof(typeof((0 ? 2.0f : (_Complex double) 2.0f))) - sizeof(_Complex double))]; + // Check for proper codegen + (0 ? 2.0f : (_Complex double) 2.0f); +} + +void t92() { + // Check for proper type promotion of conditional expression + char c[(int)(sizeof(typeof((0 ? (_Complex double) 2.0f : 2.0f))) - sizeof(_Complex double))]; + // Check for proper codegen + (0 ? (_Complex double) 2.0f : 2.0f); +} + |