summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/const-eval.c
Commit message (Collapse)AuthorAgeFilesLines
* fix PR7885, rejecting invalid uses of __builtin_constant_p.Chris Lattner2010-10-121-1/+1
| | | | llvm-svn: 116317
* PR7884: Fix the implementations of __real__ and __imag__ on real floats.Eli Friedman2010-08-141-2/+6
| | | | llvm-svn: 111080
* Make the "unused result" warning a warning about run-time behavior, soDouglas Gregor2010-07-151-1/+1
| | | | | | that we don't warn when there isn't going to be any computation anyway. llvm-svn: 108442
* Fix rdar://8139785 "implement warning on dead expression in comma operator"Argyrios Kyrtzidis2010-06-301-1/+1
| | | | | | | | | | 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'. llvm-svn: 107274
* Fix for PR6274: teach constant folding to evaluate __builtin_expect.Eli Friedman2010-02-131-0/+1
| | | | llvm-svn: 96054
* Update tests to use %clang_cc1 instead of 'clang-cc' or 'clang -cc1'.Daniel Dunbar2009-12-151-1/+1
| | | | | | | | | - 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). llvm-svn: 91446
* Add constant evaluation for comma operator with floating-point operand. FixesEli Friedman2009-11-161-0/+2
| | | | | | PR5449. llvm-svn: 88885
* Make ASTContext::getIntWidth return 1 for all boolean type variations, not ↵Sebastian Redl2009-11-051-0/+5
| | | | | | just for the unqualified, unaliased bool. llvm-svn: 86174
* PR4351: Add constant evaluation for constructs like "foo == NULL", where Eli Friedman2009-06-141-0/+2
| | | | | | foo has a constant address. llvm-svn: 73321
* PR4326: Handle constant evaluation for void* pointer subtraction Eli Friedman2009-06-041-0/+1
| | | | | | correctly. llvm-svn: 72886
* PR4097: add logic to Evaluate to handle pointer equality comparisons.Eli Friedman2009-04-281-0/+2
| | | | llvm-svn: 70317
* Add handling for complex->int, int->complex float, and float->complex Eli Friedman2009-04-221-0/+2
| | | | | | | int. Note that constant int->complex float and float->complex int casts were being miscompiled. llvm-svn: 69821
* Fix PR4027 + rdar://6808859, we were rejecting implicit casts ofChris Lattner2009-04-211-0/+6
| | | | | | aggregates even though we already accept explicit ones. Easy fix. llvm-svn: 69661
* Rename clang to clang-cc.Daniel Dunbar2009-03-241-1/+1
| | | | | | Tests and drivers updated, still need to shuffle dirs. llvm-svn: 67602
* Minor enhancements to Evaluate.Eli Friedman2009-03-231-0/+5
| | | | llvm-svn: 67503
* Fix invalid VLAs/VMs in Sema::ActOnVariableDeclarator, so that the variable ↵Anders Carlsson2009-02-281-0/+3
| | | | | | | | | | | 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. llvm-svn: 65725
* Fix obvious shortcoming in the implementations of Evaluate for Eli Friedman2009-02-281-0/+5
| | | | | | integer __real__ and __imag__. Not sure how I missed this. llvm-svn: 65677
* Evaluation of unary deref could call integer evaluator on non-integralDaniel Dunbar2009-02-211-0/+2
| | | | | | | expr; hilarity ensued. - PR3640. llvm-svn: 65234
* Add support for * (unary dereference) operator to ExprConstant.Eli Friedman2009-02-201-0/+2
| | | | llvm-svn: 65105
* Emit the correct diagnostics when we constant fold an array size to a ↵Anders Carlsson2009-02-191-0/+4
| | | | | | negative value. llvm-svn: 65023
* Make sure to check the value of the constant expression, as suggested by Daniel.Anders Carlsson2009-02-191-1/+1
| | | | llvm-svn: 65021
* Handle the GNU void* and function pointer arithmetic extensions for constant ↵Anders Carlsson2009-02-191-0/+2
| | | | | | expressions as well. llvm-svn: 65013
* isICE was evaluating ?: incorrectly with missing-gcc-LHS extension.Daniel Dunbar2009-02-181-0/+3
| | | | | | | Add assert to isICE that, on success, result must be the same as EvaluateAsInt()... this enforces a minimum level of sanity. llvm-svn: 64865
* Fix invalid evaluation of _Complex float (real & imaginary parts hadDaniel Dunbar2009-01-241-0/+3
| | | | | | | mismatched semantics). - Enforce this in APValue. llvm-svn: 62924
* The address of a variable is only constant if the variable has global storage.Anders Carlsson2008-11-241-0/+6
| | | | llvm-svn: 59939
* Fix bug in the constant evaluator. Fixes PR3115.Anders Carlsson2008-11-241-0/+3
| | | | llvm-svn: 59938
* Fix for crash issues with comma operators with a void first operand, and Eli Friedman2008-11-131-0/+6
| | | | | | | | | | 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. llvm-svn: 59224
* Backout of r59196, plus a new ICE test. Sorry if this is a Eli Friedman2008-11-131-2/+0
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 59212
* Fix bug in constant evaluation exposed by 176.gcc.Daniel Dunbar2008-11-131-0/+2
| | | | | | | | | | | | - 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? llvm-svn: 59196
* Some additions to tryEvaluate I've had sitting around for a while.Eli Friedman2008-11-121-0/+13
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. llvm-svn: 59125
OpenPOWER on IntegriCloud