aboutsummaryrefslogtreecommitdiff
path: root/test/CodeGen/conditional-gnu-ext.c
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-09-18 19:38:38 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-09-18 19:38:38 +0000
commit1fb019bf42f5757c027edb56e5bb70233787a39c (patch)
tree9c0c0bd8c25faa70b59827d4dfaa216fbfeceb16 /test/CodeGen/conditional-gnu-ext.c
parent97fe61ca1749110c28eb4570a710c8983711c7b3 (diff)
Problem with gnu conditional extension with missing
LHS and when conditional expression is an array. Since it will be decayed, saved expression must be saved with decayed expression. This is necessary to preserve semantics of this extension (and prevent an IRGen crash which expects an array to always be decayed). I am sure there will be other cases in c++ (aggregate conditionals for example) when saving of the expression must happen after some transformation on conditional expression has happened. Doug, please review. Fixes // rdar://8446940 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114296 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/CodeGen/conditional-gnu-ext.c')
-rw-r--r--test/CodeGen/conditional-gnu-ext.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/CodeGen/conditional-gnu-ext.c b/test/CodeGen/conditional-gnu-ext.c
index f4ac81bf59..5e5801af93 100644
--- a/test/CodeGen/conditional-gnu-ext.c
+++ b/test/CodeGen/conditional-gnu-ext.c
@@ -10,3 +10,12 @@ float test(float x, int Y) {
return Y != 0 ? : x;
}
+// rdar://8446940
+extern void abort();
+void test1 () {
+ char x[1];
+ char *y = x ? : 0;
+
+ if (x != y)
+ abort();
+}