summaryrefslogtreecommitdiffstats
path: root/clang/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp
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
commit2b1d88abfb0f113833de02562457625aba819ef0 (patch)
tree338e88f8d82fec206a3d38e6852a9036c79c39ea /clang/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp
parentdbb199d89b58f4c2f1060dc209cd04ceb077e564 (diff)
downloadbcm5719-llvm-2b1d88abfb0f113833de02562457625aba819ef0.tar.gz
bcm5719-llvm-2b1d88abfb0f113833de02562457625aba819ef0.zip
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 llvm-svn: 114296
Diffstat (limited to 'clang/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp')
-rw-r--r--clang/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/clang/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp b/clang/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp
index 8c529c30e17..dfd9d414895 100644
--- a/clang/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp
+++ b/clang/test/CodeGenCXX/gnu-conditional-scalar-ext.cpp
@@ -9,3 +9,16 @@ int main(int argc, char **argv) {
printf("%p\n", (void *)0xdeadbeef ? : (void *)0xaaaaaa);
return 0;
}
+
+// rdar://8446940
+namespace radar8446940 {
+extern "C" void abort();
+
+int main () {
+ char x[1];
+ char *y = x ? : 0;
+
+ if (x != y)
+ abort();
+}
+}
OpenPOWER on IntegriCloud