1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-23 03:02:36 +01:00
llvm-mirror/test/DebugInfo/Inputs/dwarfdump-test-zlib.cc
Fangrui Song b2d3b0af04 [llvm-readobj] Change -long-option to --long-option in tests. NFC
We use both -long-option and --long-option in tests. Switch to --long-option for consistency.

In the "llvm-readelf" mode, -long-option is discouraged as it conflicts with grouped short options and it is not accepted by GNU readelf.

While updating the tests, change llvm-readobj -s to llvm-readobj -S to reduce confusion ("s" is --section-headers in llvm-readobj but --symbols in llvm-readelf).

llvm-svn: 359649
2019-05-01 05:27:20 +00:00

29 lines
971 B
C++

class DummyClass {
int a_;
public:
DummyClass(int a) : a_(a) {}
int add(int b) {
return a_ + b;
}
};
int f(int a, int b) {
DummyClass c(a);
return c.add(b);
}
int main() {
return f(2, 3);
}
// Built with Clang 3.9 and GNU gold (GNU Binutils for Ubuntu 2.26) 1.11:
// Note: llvm-symbolizer-zlib.test relies on the path and filename used !
// $ mkdir -p /tmp/dbginfo
// $ cp dwarfdump-test-zlib.cc /tmp/dbginfo
// $ cd /tmp/dbginfo
// $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib -o dwarfdump-test-zlib.elf-x86-64
// $ clang++ -g dwarfdump-test-zlib.cc -Wa,--compress-debug-sections=zlib -c -o dwarfdump-test-zlib.o.elf-x86-64
// $ clang++ -g dwarfdump-test-zlib.cc -Wl,--compress-debug-sections=zlib-gnu -o dwarfdump-test-zlibgnu.elf-x86-64
// llvm-readobj --sections can be used to see that outputs really contain the compressed sections, also output in both
// cases is slightly smaller, that is because of compression.