summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser/expressions.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/Parser/expressions.c')
-rw-r--r--clang/test/Parser/expressions.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/Parser/expressions.c b/clang/test/Parser/expressions.c
new file mode 100644
index 00000000000..a5214509d83
--- /dev/null
+++ b/clang/test/Parser/expressions.c
@@ -0,0 +1,21 @@
+// RUN: clang -fsyntax-only %s
+
+void test1() {
+ if (sizeof (int){ 1}); // sizeof compound literal
+ if (sizeof (int)); // sizeof type
+
+ (int)4; // cast.
+ (int){4}; // compound literal.
+
+ // FIXME: change this to the struct version when we can.
+ //int A = (struct{ int a;}){ 1}.a;
+ int A = (int){ 1}.a;
+}
+
+int test2(int a, int b) {
+ return a ? a,b : a;
+}
+
+int test3(int a, int b) {
+ return a = b = c;
+}
OpenPOWER on IntegriCloud