blob: 714673f2e2313fbae065ba4fe2b8b43776acbe8f [file] [log] [blame]
Alexey Samsonov068fc8a2013-04-23 10:17:34 +00001class DummyClass {
2 int a_;
3 public:
4 DummyClass(int a) : a_(a) {}
5 int add(int b) {
6 return a_ + b;
7 }
8};
9
10int f(int a, int b) {
11 DummyClass c(a);
12 return c.add(b);
13}
14
15int main() {
16 return f(2, 3);
17}
18
George Rimar401e4e52016-05-24 12:48:46 +000019// Built with Clang 3.9 and GNU gold (GNU Binutils for Ubuntu 2.26) 1.11:
20// Note: llvm-symbolizer-zlib.test relies on the path and filename used !
Alexey Samsonov068fc8a2013-04-23 10:17:34 +000021// $ mkdir -p /tmp/dbginfo
22// $ cp dwarfdump-test-zlib.cc /tmp/dbginfo
23// $ cd /tmp/dbginfo
George Rimar401e4e52016-05-24 12:48:46 +000024// $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib -o dwarfdump-test-zlib.elf-x86-64
David Blaikiea91885a2017-06-10 19:32:50 +000025// $ clang++ -g dwarfdump-test-zlib.cc -Wa,--compress-debug-sections=zlib -c -o dwarfdump-test-zlib.o.elf-x86-64
George Rimar401e4e52016-05-24 12:48:46 +000026// $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib-gnu -o dwarfdump-test-zlibgnu.elf-x86-64
Fangrui Songe29e30b2019-05-01 05:27:20 +000027// llvm-readobj --sections can be used to see that outputs really contain the compressed sections, also output in both
David Blaikiea91885a2017-06-10 19:32:50 +000028// cases is slightly smaller, that is because of compression.