Alexey Samsonov | 068fc8a | 2013-04-23 10:17:34 +0000 | [diff] [blame] | 1 | class DummyClass { |
| 2 | int a_; |
| 3 | public: |
| 4 | DummyClass(int a) : a_(a) {} |
| 5 | int add(int b) { |
| 6 | return a_ + b; |
| 7 | } |
| 8 | }; |
| 9 | |
| 10 | int f(int a, int b) { |
| 11 | DummyClass c(a); |
| 12 | return c.add(b); |
| 13 | } |
| 14 | |
| 15 | int main() { |
| 16 | return f(2, 3); |
| 17 | } |
| 18 | |
George Rimar | 401e4e5 | 2016-05-24 12:48:46 +0000 | [diff] [blame] | 19 | // 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 Samsonov | 068fc8a | 2013-04-23 10:17:34 +0000 | [diff] [blame] | 21 | // $ mkdir -p /tmp/dbginfo |
| 22 | // $ cp dwarfdump-test-zlib.cc /tmp/dbginfo |
| 23 | // $ cd /tmp/dbginfo |
George Rimar | 401e4e5 | 2016-05-24 12:48:46 +0000 | [diff] [blame] | 24 | // $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib -o dwarfdump-test-zlib.elf-x86-64 |
David Blaikie | a91885a | 2017-06-10 19:32:50 +0000 | [diff] [blame] | 25 | // $ clang++ -g dwarfdump-test-zlib.cc -Wa,--compress-debug-sections=zlib -c -o dwarfdump-test-zlib.o.elf-x86-64 |
George Rimar | 401e4e5 | 2016-05-24 12:48:46 +0000 | [diff] [blame] | 26 | // $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib-gnu -o dwarfdump-test-zlibgnu.elf-x86-64 |
Fangrui Song | e29e30b | 2019-05-01 05:27:20 +0000 | [diff] [blame] | 27 | // llvm-readobj --sections can be used to see that outputs really contain the compressed sections, also output in both |
David Blaikie | a91885a | 2017-06-10 19:32:50 +0000 | [diff] [blame] | 28 | // cases is slightly smaller, that is because of compression. |