xref: /minix3/external/bsd/llvm/dist/clang/test/CodeGen/offsetof.c (revision f4a2713ac843a11c696ec80c0a5e3e5d80b4d338)
1*f4a2713aSLionel Sambuc // RUN: %clang_cc1 %s -emit-llvm -o %t
2*f4a2713aSLionel Sambuc 
3*f4a2713aSLionel Sambuc // PR2910
4*f4a2713aSLionel Sambuc struct sockaddr_un {
5*f4a2713aSLionel Sambuc  unsigned char sun_len;
6*f4a2713aSLionel Sambuc  char sun_path[104];
7*f4a2713aSLionel Sambuc };
8*f4a2713aSLionel Sambuc 
test(int len)9*f4a2713aSLionel Sambuc int test(int len) {
10*f4a2713aSLionel Sambuc   return __builtin_offsetof(struct sockaddr_un, sun_path[len+1]);
11*f4a2713aSLionel Sambuc }
12*f4a2713aSLionel Sambuc 
13