File: 2006-11-30-NoCompileUnit.cpp

package info (click to toggle)
llvm-2.7 2.7-6
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 59,992 kB
  • ctags: 49,499
  • sloc: cpp: 373,792; ansic: 16,885; sh: 12,614; asm: 6,809; ada: 3,083; ml: 2,942; python: 2,671; perl: 2,404; makefile: 1,691; pascal: 1,235; exp: 399; objc: 291; lisp: 184; csh: 117; xml: 38; f90: 36
file content (60 lines) | stat: -rw-r--r-- 1,171 bytes parent folder | download
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
53
54
55
56
57
58
59
60
// This is a regression test on debug info to make sure we don't hit a compile 
// unit size issue with gdb.
// RUN: %llvmgcc -S -O0 -g %s -o - | \
// RUN:   llc --disable-fp-elim -o NoCompileUnit.s
// RUN: %compile_c NoCompileUnit.s -o NoCompileUnit.o
// RUN: %link NoCompileUnit.o -o NoCompileUnit.exe
// RUN: echo {break main\nrun\np NoCompileUnit::pubname} > %t2
// RUN: gdb -q -batch -n -x %t2 NoCompileUnit.exe | \
// RUN:   tee NoCompileUnit.out | not grep {"low == high"}
// XFAIL: alpha,arm
// XFAIL: *
// See PR2454


class MamaDebugTest {
private:
  int N;
  
protected:
  MamaDebugTest(int n) : N(n) {}
  
  int getN() const { return N; }

};

class BabyDebugTest : public MamaDebugTest {
private:

public:
  BabyDebugTest(int n) : MamaDebugTest(n) {}
  
  static int doh;
  
  int  doit() {
    int N = getN();
    int Table[N];
    
    int sum = 0;
    
    for (int i = 0; i < N; ++i) {
      int j = i;
      Table[i] = j;
    }
    for (int i = 0; i < N; ++i) {
      int j = Table[i];
      sum += j;
    }
    
    return sum;
  }

};

int BabyDebugTest::doh;


int main(int argc, const char *argv[]) {
  BabyDebugTest BDT(20);
  return BDT.doit();
}