History log of /external/clang/test/Sema/const-eval.c
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/test/Sema/const-eval.c
26dc97cbeba8ced19972a259720a71aefa01ef43 17-Jul-2012 Eli Friedman <eli.friedman@gmail.com> Don't treat overflow in floating-point conversions as a hard error in constant evaluation. <rdar://problem/11874571>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160394 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
2850376184b7e7aa81b5034ba44b001f8c55e07a 16-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Per Richard's comments on r154794, add the checks necessary to handle constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154849 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
a31698842e9893559d58a7bf1a987f2ae90bea0b 16-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Make constant evaluation for pointer comparisons work correctly for some uncommon cases. <rdar://problem/10962435>.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154794 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
16aac6f6eb31eb5118424773411867fc3cd5fbc6 12-Apr-2012 Eli Friedman <eli.friedman@gmail.com> Add test for a construct we currently reject, constant-evaluating a load from a constant string. Given that gcc doesn't accept this, we should continue to not accept it, even though it was accidentally supported by clang for a brief period.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154564 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
51e47df5a57430f1b691b04258e663cce68aef9d 21-Feb-2012 Eli Friedman <eli.friedman@gmail.com> Fix a crash in the diangostic code in EvalConstant. PR12043.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
f2e4cd760a5836ee8941d1b9be6b2e2c2dde23e6 26-Jan-2012 Richard Smith <richard-llvm@metafoo.co.uk> constexpr: evaluate (bool)&x as true when x is a local variable or a temporary.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
aa9c3503867bc52e1f61c4da676116db1b1cdf01 07-Dec-2011 Richard Smith <richard-llvm@metafoo.co.uk> When folding the size of a global scope VLA to a constant, require the array
bound to not have side effects(!). Add constant-folding support for expressions
of void type, to ensure that we can still fold ((void)0, 1) as an array bound.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@146000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
2ad226bdc847df6b6b6e4f832856478ab63bb3dc 16-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> PR11391: Don't try to evaluate the LHS of a _Complex assignment as an rvalue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
b755a9da095d2f2f04444797f1e1a9511693815b 16-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix PR11385: A pointer constant expression which has been cast via an integer is
not safely derived. Don't allow lvalue-to-rvalue conversions on the result of
dereferencing such a pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144783 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
ddadaa4579dbb12dcfad62ee86e1e52e12f298ee 12-Nov-2011 Eli Friedman <eli.friedman@gmail.com> Add missing casts to AST.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144455 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
74f4634781cee06e28eb741bda5d0f936fdd1948 04-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> Constant expression evaluation: although we don't know whether a literal will
be at the same address as another object, we do know it won't alias a null
pointer.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143674 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
65ac598c7ba7e36f2ad611f2bb39cc957053be5d 01-Nov-2011 Richard Smith <richard-llvm@metafoo.co.uk> When constant-folding, don't look at the initializer of a global const variable
if it's marked as weak: that definition may not end up being used.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143496 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
6a7c94af983717e2c2d6aebe42cb4737c1c7b9e6 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Refactoring and test for r143360. Support for array rvalue to pointer decay is
needed for C++11, and will follow later.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143363 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
7993e8a2a26bf408c2a6d45f24fffa12db336b2b 31-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix assert on constant expression evaluation of floating point increment.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
342f1f8b0a402c5a7f8c5055db7f60a7808f1687 30-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Don't crash if a GCC binary conditional is used in a constant expression on an
integer-cast pointer value.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
ee591a90c2e26c1ba33a4befb364a1c35fb2c311 29-Oct-2011 Richard Smith <richard-llvm@metafoo.co.uk> Fix assertion in constant expression evaluation. The LHS of a floating-point
binary operator isn't an rvalue if it's an assignment operator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143250 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
e1eed38733ed47d44f9d8c7731817c411eaf4141 14-Jun-2011 Chris Lattner <sabre@nondot.org> when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be folded to a constant
as constant size arrays. This has slightly different semantics in some insane cases, but allows
us to accept some constructs that GCC does. Continue to be pedantic in -std=c99 and other
modes. This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@132983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
e224ba7e3e604113aa160c379293bcb6425e8f36 07-Mar-2011 Carl Norum <carl.norum@apple.com> Fix tests to account for new warning "expected ';' at end of declaration list". Sorry, folks!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@127188 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
e188933adf2cfe2821b8acba2de6d5d152bc246b 18-Jan-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Properly do a float -> _Complex double conversion, fixes rdar://8875946.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@123759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
75c29a012793292ff4578015a9113bf086156d7f 12-Oct-2010 Chris Lattner <sabre@nondot.org> fix PR7885, rejecting invalid uses of __builtin_constant_p.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
43efa31fe601bb7c3f132f02246dc3c903d9f361 14-Aug-2010 Eli Friedman <eli.friedman@gmail.com> PR7884: Fix the implementations of __real__ and __imag__ on real floats.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@111080 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
35e12c90c1b107a75c5615aa76fdbd403661aaa6 15-Jul-2010 Douglas Gregor <dgregor@apple.com> Make the "unused result" warning a warning about run-time behavior, so
that we don't warn when there isn't going to be any computation anyway.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108442 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
25973455aed1cdc9c40b208c792b5db4f8f1297d 30-Jun-2010 Argyrios Kyrtzidis <akyrtzi@gmail.com> Fix rdar://8139785 "implement warning on dead expression in comma operator"

As a bonus, fix the warning for || and && operators; it was emitted even if one of the operands had side effects, e.g:

x || test_logical_foo1();

emitted a bogus "expression result unused" for 'x'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@107274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
c4a2638b5ef3e2d35d872614ceb655a7a22c58be 13-Feb-2010 Eli Friedman <eli.friedman@gmail.com> Fix for PR6274: teach constant folding to evaluate __builtin_expect.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@96054 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
a5728872c7702ddd09537c95bc3cbd20e1f2fb09 15-Dec-2009 Daniel Dunbar <daniel@zuster.org> Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.
- This is designed to make it obvious that %clang_cc1 is a "test variable"
which is substituted. It is '%clang_cc1' instead of '%clang -cc1' because it
can be useful to redefine what gets run as 'clang -cc1' (for example, to set
a default target).

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
7f92f0362ef2cf218bc19bb83e1a97dd254b5527 16-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Add constant evaluation for comma operator with floating-point operand. Fixes
PR5449.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
632d772a78db7e2cd9b36f8a22aee49d44486fbf 05-Nov-2009 Sebastian Redl <sebastian.redl@getdesigned.at> Make ASTContext::getIntWidth return 1 for all boolean type variations, not just for the unqualified, unaliased bool.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86174 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
5bc86103767c2abcbfdd6518e0ccbbbb6aa59e0f 14-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4351: Add constant evaluation for constructs like "foo == NULL", where
foo has a constant address.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@73321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
147bd641dd264fde2fc5a0074f30eace71016ea9 04-Jun-2009 Eli Friedman <eli.friedman@gmail.com> PR4326: Handle constant evaluation for void* pointer subtraction
correctly.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
ad02d7debd03ff275ac8ea27891a4ecccdb78068 28-Apr-2009 Eli Friedman <eli.friedman@gmail.com> PR4097: add logic to Evaluate to handle pointer equality comparisons.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70317 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
1725f683432715e5afe34d476024bd6f16eac3fc 22-Apr-2009 Eli Friedman <eli.friedman@gmail.com> Add handling for complex->int, int->complex float, and float->complex
int. Note that constant int->complex float and float->complex int casts
were being miscompiled.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
81045d8dcd967def69d8e0945566214a9fe9ffcc 21-Apr-2009 Chris Lattner <sabre@nondot.org> Fix PR4027 + rdar://6808859, we were rejecting implicit casts of
aggregates even though we already accept explicit ones. Easy fix.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@69661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
d7d5f0223bd30dfd618762349c6209dd1d5ea3e6 24-Mar-2009 Daniel Dunbar <daniel@zuster.org> Rename clang to clang-cc.

Tests and drivers updated, still need to shuffle dirs.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67602 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
a1f47c447a919c6a05c63801cb6a52c4c288e2cc 23-Mar-2009 Eli Friedman <eli.friedman@gmail.com> Minor enhancements to Evaluate.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67503 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
1a7acfa0de7364b24599be4329d7ee2944540428 28-Feb-2009 Anders Carlsson <andersca@mac.com> Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable will have the right type by the time the initializer is checked. This ensures that code like

int a[(int)(1.0 / 1.0) = { 1 } will work.

Eli, please review.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
722c717cd833e410ca6e7976d78baea16995e0c4 28-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Fix obvious shortcoming in the implementations of Evaluate for
integer __real__ and __imag__. Not sure how I missed this.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65677 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
4fff4819a913c65ae23cfd389bc47c61919e4e1f 21-Feb-2009 Daniel Dunbar <daniel@zuster.org> Evaluation of unary deref could call integer evaluator on non-integral
expr; hilarity ensued.
- PR3640.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65234 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
e8761c8fe2ee6b628104a0885f49fd3c21c08a4f 20-Feb-2009 Eli Friedman <eli.friedman@gmail.com> Add support for * (unary dereference) operator to ExprConstant.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65105 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
1c17689a6703331c656ae79bb756bf606d63f71a 19-Feb-2009 Anders Carlsson <andersca@mac.com> Emit the correct diagnostics when we constant fold an array size to a negative value.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65023 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
e2f0e96e9b34ed7fb0d44f6b9288b9fcf5548ba3 19-Feb-2009 Anders Carlsson <andersca@mac.com> Make sure to check the value of the constant expression, as suggested by Daniel.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
4d4c50dd8b4db191c38782414665fb7608315a36 19-Feb-2009 Anders Carlsson <andersca@mac.com> Handle the GNU void* and function pointer arithmetic extensions for constant expressions as well.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@65013 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
2d6744ff04c1690a1485178d550d2fab84a0270b 18-Feb-2009 Daniel Dunbar <daniel@zuster.org> isICE was evaluating ?: incorrectly with missing-gcc-LHS extension.

Add assert to isICE that, on success, result must be the same as
EvaluateAsInt()... this enforces a minimum level of sanity.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@64865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
8f826f0e0c90b05ab04e84c29157d2e965713288 24-Jan-2009 Daniel Dunbar <daniel@zuster.org> Fix invalid evaluation of _Complex float (real & imaginary parts had
mismatched semantics).
- Enforce this in APValue.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
35873c49adad211ff466e34342a52665742794f5 24-Nov-2008 Anders Carlsson <andersca@mac.com> The address of a variable is only constant if the variable has global storage.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
4bbc0e05a714d4ee4918a92a4a7049dd6ef33ad0 24-Nov-2008 Anders Carlsson <andersca@mac.com> Fix bug in the constant evaluator. Fixes PR3115.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59938 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
a6afa768aa7bd3102a2807aa720917e4a1771e4e 13-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Fix for crash issues with comma operators with a void first operand, and
some more bullet-proofing/enhancements for tryEvaluate. This shouldn't
cause any behavior changes except for handling cases where we were
crashing before and being able to evaluate a few more cases in tryEvaluate.

This should settle the minor mess surrounding r59196.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
b11e77836dd0867955c5abf32baf1c3e6c7f81e1 13-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Backout of r59196, plus a new ICE test. Sorry if this is a
little rude; I figure it's cleaner to just back this out now so
it doesn't get forgotten or mixed up with other checkins.

The modification to isICE is simply wrong; I've added a test that the
change to isICE breaks.

I'm pretty sure the modification to tryEvaluate is also wrong.
At the very least, there's some serious miscommunication going on here,
as this is going in exactly the opposite direction of r59105. My
understanding is that tryEvaluate is not supposed to care about side
effects. That said, a lot of the clients to tryEvaluate are
expecting it to enforce a no-side-effects policy, so we probably need
another method that provides that guarantee.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59212 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
dd2b12a0329fee69ac2c26c2a3a355fb722e1e54 13-Nov-2008 Daniel Dunbar <daniel@zuster.org> Fix bug in constant evaluation exposed by 176.gcc.
- Evaluation of , operator used bogus assumption that LHS could be
evaluated as an integral expression even though its type is
unspecified.

This change is making isICE very permissive of the LHS in non-evaluated
contexts because it is not clear what predicate we would use to reject
code here. The standard didn't offer me any guidance; opinions?


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59196 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c
4efaa276bc0ce8f7baf6138ead11915f3e3e58d9 12-Nov-2008 Eli Friedman <eli.friedman@gmail.com> Some additions to tryEvaluate I've had sitting around for a while.
This pushes it a lot closer to being able to deal with most of the stuff
CodeGen's constant expression evaluator knows how to deal with. This
also fixes PR3003.

The test could possibly use some improvement, but this'll work for now.
Test 6 is inspired by PR3003; the other tests are mostly just designed
to exercise the new code. The reason for the funny structure of the
tests is that type fixing for arrays inside of structs is the only place
in Sema that calls tryEvaluate, at least for the moment.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59125 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/test/Sema/const-eval.c