blob: cded6da7be1e86e772c27c822d62bc2b6a52adf5 [file] [log] [blame]
Fariborz Jahanianc2316db2013-01-10 23:28:43 +00001// RUN: %clang_cc1 -std=c++11 -S -emit-llvm -o %t-c++11.ll %s -triple x86_64-apple-darwin10
Fariborz Jahanian319437f2013-01-11 17:33:57 +00002// RUN: FileCheck %s < %t-c++11.ll
3// RUN: %clang_cc1 -std=c++98 -S -emit-llvm -o %t.ll %s -triple x86_64-apple-darwin10
Fariborz Jahanianc2316db2013-01-10 23:28:43 +00004// RUN: diff %t.ll %t-c++11.ll
5
6// rdar://12897704
7
8struct sAFSearchPos {
9 unsigned char *pos;
10 unsigned char count;
11};
12
13static volatile struct sAFSearchPos testPositions;
Fariborz Jahaniane930ff52013-01-11 00:55:44 +000014// CHECK: @_ZL13testPositions = internal global %struct.sAFSearchPos zeroinitializer
Fariborz Jahanianc2316db2013-01-10 23:28:43 +000015
16static volatile struct sAFSearchPos arrayPositions[100][10][5];
Fariborz Jahaniane930ff52013-01-11 00:55:44 +000017// CHECK: @_ZL14arrayPositions = internal global [100 x [10 x [5 x %struct.sAFSearchPos]]] zeroinitializer
Fariborz Jahanianc2316db2013-01-10 23:28:43 +000018
19int main() {
20 return testPositions.count + arrayPositions[10][4][3].count;
21}