xref: /llvm-project/clang/test/CodeGen/2003-11-03-AddrArrayElement.c (revision 85e5156598b1bbad0ae41cf4d0d5b845dd655ffd)
1*85e51565SEric Christopher // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2*85e51565SEric Christopher 
3*85e51565SEric Christopher // This should be turned into a tasty getelementptr instruction, not a nasty
4*85e51565SEric Christopher // series of casts and address arithmetic.
5*85e51565SEric Christopher 
6*85e51565SEric Christopher char Global[100];
7*85e51565SEric Christopher 
test1(unsigned i)8*85e51565SEric Christopher char *test1(unsigned i) {
9*85e51565SEric Christopher   // CHECK: getelementptr
10*85e51565SEric Christopher   return &Global[i];
11*85e51565SEric Christopher }
12