xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/2008-08-07-GEPIntToPtr.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 -emit-llvm %s -o - | FileCheck %s
2*f4a2713aSLionel Sambuc // PR2603
3*f4a2713aSLionel Sambuc 
4*f4a2713aSLionel Sambuc struct A {
5*f4a2713aSLionel Sambuc   char num_fields;
6*f4a2713aSLionel Sambuc };
7*f4a2713aSLionel Sambuc 
8*f4a2713aSLionel Sambuc struct B {
9*f4a2713aSLionel Sambuc   char a, b[1];
10*f4a2713aSLionel Sambuc };
11*f4a2713aSLionel Sambuc 
12*f4a2713aSLionel Sambuc const struct A Foo = {
13*f4a2713aSLionel Sambuc   // CHECK: i8 1
14*f4a2713aSLionel Sambuc   (char *)(&( (struct B *)(16) )->b[0]) - (char *)(16)
15*f4a2713aSLionel Sambuc };
16