Anders Carlsson
3907323dd6
GCC has an extension where the left hand side of the ? : operator can be omitted. Handle this in a few more places.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44462 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 19:04:31 +00:00
Chris Lattner
3e47be5c90
fix a bug handling typedefs in member expr codegen. Patch
...
by Seo Sanghyeon
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44455 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 18:02:19 +00:00
Chris Lattner
2202bce80f
Fix a codegen crash on void ?: reported by Oliver
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44454 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 17:56:23 +00:00
Chris Lattner
c69a5810f4
Support fully general case expressions, patch by Sanghyeon Seo!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44453 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 17:44:57 +00:00
Christopher Lamb
fbd91735c8
Doh! Check in this long overdue test fix.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44450 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 06:35:48 +00:00
Anders Carlsson
695dbb697d
Support lax vector conversions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44449 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-30 04:21:22 +00:00
Ted Kremenek
502654085f
Added "complex.c" (a copy of test/Codegen/complex.) to the serialization
...
test suite.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44439 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 19:05:51 +00:00
Christopher Lamb
016765e345
Support floating point literals of the form "1e-16f" which specify an exponent but no decimal point.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44431 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 06:06:27 +00:00
Ted Kremenek
b594a40589
Fixed test case to not expect a warning when one should not be emitted.
...
Removed redundant test case.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44426 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 01:03:21 +00:00
Ted Kremenek
9e7f0ecab9
Added test cases for -Wfloat-equal to test comparisons against literals that can be
...
represented exactly and inexactly by APFloats. For the former, we do not emit a
warning.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-29 01:00:11 +00:00
Ted Kremenek
251f7325b3
Inlined test case to make it independent of the stmt_exprs test case in test/Sema.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44416 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 21:29:54 +00:00
Ted Kremenek
efb71539a7
Added the "Serialization" test directory to the set of tests executed.
...
Introduced a few line breaks to make the Makefile easier to read.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44413 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 19:24:15 +00:00
Ted Kremenek
f387aeb136
Added initial test case for testing serialization of ASTs. This test
...
case simply performs --test-pickling on the code found in Sema/stmt_exprs.c.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44412 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 19:23:15 +00:00
Ted Kremenek
6a18c7689b
Changed TestRunner.sh to dump the output and generated script files in
...
subdirectories mirroring where the test case file is located
For example, for the test case "Sema/stmt_exprs.c", instead of the files
"Output/stmt_exprs.c.out" and "Output/stmt_exprs.c.out.script" being created, the
files "Output/Sema/stmt_exprs.c.out" and "Output/Sema/stmt_exprs.c.out.script" are
created. This prevents any collisions from different test directories that have the
same file name for a test case, and also makes it clear where the test case was
drawn from.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44410 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 19:16:54 +00:00
Ted Kremenek
83c903f1ab
Added missing "RUN:" to comment for test case file. This fixed a bug where the test
...
case testing the frontend's support of statement expressions was not being
executed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44409 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 19:05:11 +00:00
Chris Lattner
b751c28a1a
Fix a bug checking for 'int foo(void)' that didn't look through typedefs of void.
...
Bug pointed out by Michael Zolda, thanks!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44408 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 18:51:29 +00:00
Oliver Hunt
0d3b50ec86
Fix typo in writable string test
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44398 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 06:52:03 +00:00
Oliver Hunt
01acb91aff
Adding code gen tests for writable and shared string literals.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44397 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 06:27:12 +00:00
Anders Carlsson
dd1b516f2f
Add more intrinsics. We can now correctly parse both Carbon.h and Cocoa.h without having to do -arch ppc.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44392 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 05:19:59 +00:00
Chris Lattner
4cc6271114
add several cases that Expr::hasStaticStorage missed, pointed out by Oliver Hunt
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44376 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 21:35:27 +00:00
Steve Naroff
529a4ad63b
Move the null pointer constant check from Sema::CheckSingleInitializer/ActOnCallExpr/CheckMessageArgumentTypes/ActOnReturnStmt to Sema::CheckSingleAssignmentConstraints. This makes sure all null pointer assignments are considered compatible.
...
Thanks to Seo Sanghyeon for the bug, follow-through, and patch!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44366 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 17:58:44 +00:00
Anders Carlsson
a64db8fa2a
Report errors for invalid casts from/to vectors.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44350 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 05:51:55 +00:00
Ted Kremenek
3f35148aa8
Fixed #include of objc/objc.h so that it works on case-sensitive filesystems.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44337 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 22:49:09 +00:00
Fariborz Jahanian
2c7038b298
Patch to fix a regression caused by recent rewrite changes.
...
A potential API bug in ReplaceText pending (A FIXME is added).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44333 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 19:52:57 +00:00
Bill Wendling
f5f20bdf91
The checking for the delimiters of expected error/warning messages was
...
looking only for { and } instead of {{ and }}. Changed it to check for
this explicitly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44326 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 08:26:20 +00:00
Chris Lattner
a21ddb30e5
Fix sema support for the gnu ?: expression with a
...
missing middle expression, and fix a codegen bug where
we didn't correctly promote the condition to the right
result type. This fixes PR1824.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44322 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 01:40:58 +00:00
Chris Lattner
09376fd7f7
this works.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44321 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-26 01:39:17 +00:00
Anders Carlsson
6fa9086043
Check that the clobber registers are valid.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44311 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-25 00:25:21 +00:00
Ted Kremenek
ca7aa1f9ca
Added more test cases for uninitialized values checker.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44307 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 23:06:58 +00:00
Ted Kremenek
ff7c538f7c
Fixed bogus culling of uninitialized-values "taint" propagation during assignments.
...
We accidentally were throttling the propagation of uninitialized state across
assignments (e.g. x = y). Thanks to Anders Carlsson for spotting this problem.
Added test cases to test suite to provide regression testing for the
uninitialized values analysis.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44306 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 20:07:36 +00:00
Ted Kremenek
bfc5e500bf
Moved dead-stores test cast to a new test suite subdirectory: Analysis.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44305 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-24 19:49:35 +00:00
Chris Lattner
75cf28834e
improve codegen for global variable initializers, implementing
...
test/CodeGen/global-with-initialiser.c
Patch by Oliver Hunt!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44290 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 22:07:55 +00:00
Anders Carlsson
04728b7ea9
Check asm input and output expressions.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44289 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 19:43:50 +00:00
Chris Lattner
0c3eb29e79
Fix PR1820, an incredibly subtle macro expansion bug that Neil discovered.
...
Neil, please review this fix.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44285 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 06:50:21 +00:00
Anders Carlsson
eecf847d1e
GCC fails if there is a trailing colon but no clobbers.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44265 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-21 23:27:34 +00:00
Chris Lattner
5519644892
Improve function decl merging, patch by Oliver Hunt!
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44253 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20 19:04:50 +00:00
Ted Kremenek
74c43a0967
Added another test case for the Dead Stores checker that tests that
...
block-level expressions are evaluated the same as regular expressions. Test
case provided by Nuno Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44247 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-20 03:03:00 +00:00
Ted Kremenek
8aefcbfd3c
Added test case for dead stores checker (live variables analysis) that tests
...
for correct propagation/update of liveness information within subexpressions
of Block-Level expressions. Test case provided by Nuno Lopes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 06:38:23 +00:00
Anders Carlsson
f06273f8bb
Put back the flags field in the constant CF string type.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44222 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-19 00:25:30 +00:00
Ted Kremenek
aa395ba050
Added test case for dead-stores checker. Test case provided by Nuno Lopes.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44221 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-18 20:06:35 +00:00
Chris Lattner
f82228f6ed
Tighten up address-of checking, implementing test/Sema/expr-address-of.c.
...
This fixes a bug reported by Seo Sanghyeon.
This was meant to be committed yesterday, but the commit failed. doh.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44190 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16 17:46:48 +00:00
Chris Lattner
b283298f03
fix a bug Steve noticed, where a #import of the main file itself would fail.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44178 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-15 19:07:47 +00:00
Chris Lattner
921e9ff030
Fix a bug handling hex floats in c90 mode, pointed out by Neil.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44120 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 16:14:50 +00:00
Chris Lattner
41af093ee6
implement test/Sema/typedef-prototype.c, allowing code
...
to declare a function with a typedef:
typedef int unary_int_func(int arg);
unary_int_func add_one;
This patch contributed by Seo Sanghyeon!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44100 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-14 06:34:38 +00:00
Fariborz Jahanian
6de88a873a
Type encoding for structs.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44087 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 23:21:38 +00:00
Fariborz Jahanian
bac97d43c9
Fixed a rewrite of metadata bug when category implementation has no matching interface.
...
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44072 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 22:09:49 +00:00
Chris Lattner
4c1a2a97b2
Parse "sizeof(arr)[0]" as a sizeof of an expr if arr
...
is an expression.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44065 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 20:50:37 +00:00
Ted Kremenek
1b2c54baed
Updated test case to flag about comparisons against constants. We may
...
invert this case (i.e., not flag a warning) in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44059 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 19:18:22 +00:00
Ted Kremenek
c8f488d1c8
Modified -Wfloat-equal logic to suppress warnings where floating point values
...
are compared against builtins such as __builtin_inf.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44058 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 19:17:00 +00:00
Ted Kremenek
db87bca211
Added -Wfloat-equal option to the driver. This makes warnings about
...
floating point comparisons using == or != an opt-in rather than a default
warning.
Updated test case to use -Wfloat-equal.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44053 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-13 18:37:02 +00:00