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.cc
Frederic Riss 72b2ac666f [dwarfdump] Ignore scattered relocations for mach-o.
When encountering a scattered relocation, the code would assert trying to
access an unexisting section. I couldn't find a way to expose the result
of the processing of a scattered reloc, and I'm really unsure what the
right thing to do is. This patch just skips them during the processing in
DwarfContext and adds a mach-o file to the tests that exposed the asserting
behavior.
(This is a new failure that is being exposed by Rafael's recent work on
the libObject interfaces. I think the wrong behavior has always happened,
but now it's asserting)

llvm-svn: 243778
2015-07-31 20:22:50 +00:00

32 lines
608 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.2:
// $ mkdir -p /tmp/dbginfo
// $ cp dwarfdump-test.cc /tmp/dbginfo
// $ cd /tmp/dbginfo
// $ clang++ -g dwarfdump-test.cc -o <output>
// The result is also used as an input to .dwz tool:
// $ cp <output> output1.dwz
// $ cp <output> output2.dwz
// $ dwz -m output.dwz -r output1.dwz output2.dwz
// $ rm output2.dwz
// The mach-o version was generated using clang-3.6.2.