summaryrefslogtreecommitdiffstats
path: root/test/CodeGenCXX/array-value-initialize.cpp
blob: 27607c1c754453f0d1fb5f3db51a719b873f1572 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// RUN: %clang_cc1 -triple x86_64-apple-darwin -emit-llvm -o - %s
// RUN: %clang_cc1 -triple i386-apple-darwin -emit-llvm -o - %s

// PR5463
extern "C" int printf(...);

struct S {
  double filler;
};

struct Foo {
        Foo(void) : bar_(), dbar_(), sbar_() { 
	  for (int i = 0; i < 5; i++) {
	    printf("bar_[%d] = %d\n", i, bar_[i]);
	    printf("dbar_[%d] = %f\n", i, dbar_[i]);
	    printf("sbar_[%d].filler = %f\n", i, sbar_[i].filler);
	  }
        } 

        int bar_[5];
        double dbar_[5];
        S sbar_[5];
};

int test1(void) {
        Foo a;
}

// PR7063


struct Unit
{
  Unit() {}
  Unit(const Unit& v)  {}
};


struct Stuff
{
  Unit leafPos[1];
};


int main()
{
  
  Stuff a;
  Stuff b = a;
  
  return 0;
}