diff --git a/test/FrontendC/2008-08-07-GEPIntToPtr.c b/test/FrontendC/2008-08-07-GEPIntToPtr.c new file mode 100644 index 00000000000..3ef3b66b88f --- /dev/null +++ b/test/FrontendC/2008-08-07-GEPIntToPtr.c @@ -0,0 +1,14 @@ +// RUN: %llvmgcc -S %s -o - | grep {i8 1} +// PR2603 + +struct A { + char num_fields; +}; + +struct B { + char a, b[1]; +}; + +const struct A Foo = { + (char *)(&( (struct B *)(16) )->b[0]) - (char *)(16) +};