brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.5 KiB · db4f89f Raw
63 lines · cpp
1// RUN: %clang_cc1 -triple x86_64-apple-darwin -std=c++11 -emit-llvm %s -o - | FileCheck %s2 3extern "C" int printf(...);4 5int count;6 7struct S {8  S() : iS(++count) { printf("S::S(%d)\n", iS); }9  ~S() { printf("S::~S(%d)\n", iS); }10  int iS;11};12 13 14S arr[2][1];15S s1;16S arr1[3];17static S sarr[4];18 19int main () {}20S arr2[2];21static S sarr1[4];22S s2;23S arr3[3];24 25// CHECK: call {{.*}} @__cxa_atexit26// CHECK: call {{.*}} @__cxa_atexit27// CHECK: call {{.*}} @__cxa_atexit28// CHECK: call {{.*}} @__cxa_atexit29// CHECK: call {{.*}} @__cxa_atexit30// CHECK: call {{.*}} @__cxa_atexit31// CHECK: call {{.*}} @__cxa_atexit32// CHECK: call {{.*}} @__cxa_atexit33 34struct T {35  double d;36  int n;37  ~T();38};39T t[2][3] = { 1.0, 2, 3.0, 4, 5.0, 6, 7.0, 8, 9.0, 10, 11.0, 12 };40 41// CHECK: call {{.*}} @__cxa_atexit42// CHECK: getelementptr inbounds (%struct.T, ptr @t, i64 6)43// CHECK: call void @_ZN1TD1Ev44// CHECK: icmp eq {{.*}} @t45// CHECK: br i1 {{.*}}46 47static T t2[2][3] = { 1.0, 2, 3.0, 4, 5.0, 6, 7.0, 8, 9.0, 10, 11.0, 12 };48 49// CHECK: call {{.*}} @__cxa_atexit50// CHECK: getelementptr inbounds (%struct.T, ptr @_ZL2t2, i64 6)51// CHECK: call void @_ZN1TD1Ev52// CHECK: icmp eq {{.*}} @_ZL2t253// CHECK: br i1 {{.*}}54 55using U = T[2][3];56U &&u = U{ {{1.0, 2}, {3.0, 4}, {5.0, 6}}, {{7.0, 8}, {9.0, 10}, {11.0, 12}} };57 58// CHECK: call {{.*}} @__cxa_atexit59// CHECK: getelementptr inbounds (%struct.T, ptr @_ZGR1u_, i64 6)60// CHECK: call void @_ZN1TD1Ev61// CHECK: icmp eq {{.*}} @_ZGR1u_62// CHECK: br i1 {{.*}}63