diff options
| author | Anton Korobeynikov <asl@math.spbu.ru> | 2008-05-29 19:17:15 +0000 |
|---|---|---|
| committer | Anton Korobeynikov <asl@math.spbu.ru> | 2008-05-29 19:17:15 +0000 |
| commit | d8734cf9162bc74b3c7603e4e81cb04a983bd444 (patch) | |
| tree | 34399f40ef982abd2e6d99a134561e4a2c2be1e2 /llvm/test/FrontendC++/2006-11-30-NoCompileUnit.cpp | |
| parent | d95dcd12c9413e6e4aea5cc63acbb0edeb5ac2da (diff) | |
| download | bcm5719-llvm-d8734cf9162bc74b3c7603e4e81cb04a983bd444.tar.gz bcm5719-llvm-d8734cf9162bc74b3c7603e4e81cb04a983bd444.zip | |
For PR1338: Rename test dirs
llvm-svn: 51695
Diffstat (limited to 'llvm/test/FrontendC++/2006-11-30-NoCompileUnit.cpp')
| -rw-r--r-- | llvm/test/FrontendC++/2006-11-30-NoCompileUnit.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/llvm/test/FrontendC++/2006-11-30-NoCompileUnit.cpp b/llvm/test/FrontendC++/2006-11-30-NoCompileUnit.cpp new file mode 100644 index 00000000000..c1fa9aed894 --- /dev/null +++ b/llvm/test/FrontendC++/2006-11-30-NoCompileUnit.cpp @@ -0,0 +1,58 @@ +// 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 - | llvm-as | \ +// RUN: llc --disable-fp-elim -o NoCompileUnit.s -f +// RUN: %compile_c NoCompileUnit.s -o NoCompileUnit.o +// RUN: %compile_cxx 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|ia64|arm + + +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(); +} |

