Skip to content

Commit

Permalink
[clang][Interp] Fix up broken test case
Browse files Browse the repository at this point in the history
  • Loading branch information
tbaederr committed Feb 2, 2024
1 parent b840d29 commit 73e5466
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions clang/test/AST/Interp/c.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,17 @@ int somefunc(int i) {

/// FIXME: The following test is incorrect in the new interpreter.
/// The null pointer returns 16 from its getIntegerRepresentation().
#pragma clang diagnostic ignored "-Wpointer-to-int-cast"
struct ArrayStruct {
char n[1];
};
struct AA {
char name2[(int)&((struct ArrayStruct*)0)->n - 1]; // expected-warning {{cast to smaller integer type}} \
// expected-warning {{folded to constant array}} \
// pedantic-expected-warning {{cast to smaller integer type}} \
char name2[(int)&((struct ArrayStruct*)0)->n - 1]; // expected-warning {{folded to constant array}} \
// pedantic-expected-warning {{folded to constant array}} \
// ref-error {{array size is negative}} \
// ref-warning {{cast to smaller integer type}} \
// pedantic-ref-error {{array size is negative}} \
// pedantic-ref-warning {{cast to smaller integer type}}
// pedantic-ref-error {{array size is negative}}
};
_Static_assert(sizeof(struct AA) == 15, ""); // ref-error {{failed}} \
// ref-note {{1 == 15}} \
// ref-note {{ == 15}} \
// pedantic-ref-error {{failed}} \
// pedantic-ref-note {{1 == 15}}
// pedantic-ref-note {{ == 15}}

0 comments on commit 73e5466

Please sign in to comment.