xref: /llvm-project/clang/test/CodeGen/2003-11-08-PointerSubNotGetelementptr.c (revision 85e5156598b1bbad0ae41cf4d0d5b845dd655ffd)
1*85e51565SEric Christopher // RUN: %clang_cc1 %s -emit-llvm -o - | FileCheck %s
2*85e51565SEric Christopher 
test(char * C)3*85e51565SEric Christopher char *test(char* C) {
4*85e51565SEric Christopher   // CHECK: getelementptr
5*85e51565SEric Christopher   return C-1;   // Should turn into a GEP
6*85e51565SEric Christopher }
7*85e51565SEric Christopher 
test2(int * I)8*85e51565SEric Christopher int *test2(int* I) {
9*85e51565SEric Christopher   return I-1;
10*85e51565SEric Christopher }
11