15 lines · c
1// RUN: %clang_cc1 -fsyntax-only -verify -std=c99 -Wc11-extensions %s2// RUN: %clang_cc1 -fsyntax-only -verify -std=c89 -Wc11-extensions %s3 4int incomplete[]; // expected-warning {{tentative array definition assumed to have one element}}5int complete[6];6 7int test_comparison_between_incomplete_and_complete_pointer(void) {8 return (&incomplete < &complete) && // expected-warning {{pointer comparisons before C11 need to be between two complete or two incomplete types; 'int (*)[]' is incomplete and 'int (*)[6]' is complete}}9 (&incomplete <= &complete) && // expected-warning {{pointer comparisons before C11 need to be between two complete or two incomplete types; 'int (*)[]' is incomplete and 'int (*)[6]' is complete}}10 (&incomplete > &complete) && // expected-warning {{pointer comparisons before C11 need to be between two complete or two incomplete types; 'int (*)[]' is incomplete and 'int (*)[6]' is complete}}11 (&incomplete >= &complete) && // expected-warning {{pointer comparisons before C11 need to be between two complete or two incomplete types; 'int (*)[]' is incomplete and 'int (*)[6]' is complete}}12 (&incomplete == &complete) &&13 (&incomplete != &complete);14}15