summaryrefslogtreecommitdiff
path: root/clang/test/AST/ByteCode/c.c
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test/AST/ByteCode/c.c')
-rw-r--r--clang/test/AST/ByteCode/c.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/clang/test/AST/ByteCode/c.c b/clang/test/AST/ByteCode/c.c
index 73469d7fd6cc..b6d2a69271af 100644
--- a/clang/test/AST/ByteCode/c.c
+++ b/clang/test/AST/ByteCode/c.c
@@ -173,6 +173,10 @@ _Static_assert(CTB3, ""); // pedantic-ref-warning {{GNU extension}} \
// pedantic-expected-warning {{GNU extension}}
+void nonComplexToComplexCast(void) {
+ _Complex double z = *(_Complex double *)&(struct { double r, i; }){0.0, 1.0};
+}
+
int t1 = sizeof(int);
void test4(void) {
t1 = sizeof(int);
@@ -347,3 +351,20 @@ const int compared = strcmp(_str, (const char *)_str2); // all-error {{initializ
const int compared2 = strcmp(strcmp, _str); // all-warning {{incompatible pointer types}} \
// all-error {{initializer element is not a compile-time constant}}
+
+int foo(x) // all-warning {{a function definition without a prototype is deprecated in all versions of C}}
+int x;
+{
+ return x;
+}
+
+void bar() { // pedantic-warning {{a function declaration without a prototype}}
+ int x;
+ x = foo(); // all-warning {{too few arguments}}
+}
+
+int *_b = &a;
+void discardedCmp(void)
+{
+ (*_b) = ((&a == &a) , a); // all-warning {{left operand of comma operator has no effect}}
+}