1 // RUN: %clang_cc1 -triple x86_64-apple-darwin -Os -S -g -o - %s | FileCheck %s 2 3 int calculate(int); 4 static void test_indvars(int *Array1, int Array2[100][200]) { 5 unsigned i, j; 6 Array1[1] = Array2[3][6] = 12345; 7 8 for (i = 0; i < 100; i+=2) 9 Array1[i] = i; /* Step by non unit amount */ 10 11 for (i = 3; i < 103; i++) 12 Array1[i] = i+4; /* Step with an offset */ 13 14 for (i = 13; i < 100; i++) 15 for (j = 0; j < 100; j+=3) /* 2d array access */ 16 Array2[i][j/3] = Array2[i][i]; 17 } 18 19 20 int main() { 21 int Array[100][200], i, j; 22 double sum = 0.0; 23 24 for (i=0; i < 100; i+=2) 25 for (j=0; j < 200; j++) 26 Array[i][j] = 0; 27 test_indvars(Array[0], Array); 28 29 //CHECK: .loc 2 30 8 30 for (i=0; i < 100; i+=2) 31 for (j=0; j < 200; j++) 32 sum += Array[i][j]; 33 34 return calculate(sum); 35 } 36