Update tests for DWARF parser: store sources next to pre-built object files and provide build instructions

llvm-svn: 174711
This commit is contained in:
Alexey Samsonov 2013-02-08 14:34:33 +00:00
parent ed93eafd8f
commit 560a144924
19 changed files with 132 additions and 39 deletions

View File

@ -0,0 +1,15 @@
#include "dwarfdump-inl-test.h"
static inline int inlined_f() {
volatile int x = inlined_g();
return x;
}
int main() {
return inlined_f();
}
// Built with Clang 3.2
// $ mkdir -p /tmp/dbginfo
// $ cp dwarfdump-inl-test.* /tmp/dbginfo
// $ cd /tmp/dbginfo
// $ clang++ -O2 -gline-tables-only -fsanitize=address -fPIC -shared dwarfdump-inl-test.cc -o <output>

View File

@ -0,0 +1,9 @@
inline int inlined_h() {
volatile int z = 0;
return z;
}
inline int inlined_g() {
volatile int y = inlined_h();
return y;
}

View File

@ -0,0 +1,23 @@
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>

View File

@ -0,0 +1,3 @@
extern "C" int a() {
return 0;
}

View File

@ -0,0 +1,11 @@
extern "C" int a();
int main() {
return a();
}
// Built with gcc 4.6.3
// $ mkdir -p /tmp/dbginfo
// $ cp dwarfdump-test2-helper.cc dwarfdump-test2-main.cc /tmp/dbginfo/
// $ cd /tmp/dbginfo
// $ g++ -g dwarfdump-test2-helper.cc dwarfdump-test2-main.cc -o <output>

View File

@ -0,0 +1,7 @@
#include "dwarfdump-test3-decl2.h"
class C {
explicit C(bool a = false, bool b = false);
};
void do1() {}

View File

@ -0,0 +1 @@
void do2() { }

View File

@ -0,0 +1,12 @@
#include "dwarfdump-test3-decl.h"
C::C(bool a, bool b) {}
// Built with gcc 4.6.3
// $ mkdir -p /tmp/dbginfo/include
// $ mkdir -p /tmp/include
// $ cp dwarfdump-test3.cc /tmp/dbginfo
// $ cp dwarfdump-test3-decl.h /tmp/include
// $ cp dwarfdump-test3-decl2.h /tmp/dbginfo/include
// $ cd /tmp/dbginfo
// $ gcc dwarfdump-test3.cc -g -I/tmp/include -Iinclude -fPIC -shared -o <output>

View File

@ -0,0 +1 @@
inline void a(){}

View File

@ -0,0 +1,8 @@
#include "dwarfdump-test4-decl.h"
int c(){a();}
// Built with gcc 4.6.3
// $ mkdir -p /tmp/dbginfo
// $ cp dwarfdump-test4-*.* /tmp/dbginfo
// $ cd /tmp/dbginfo
// $ gcc -fPIC -shared -g dwarfdump-test4-part*.cc -o <output>

View File

@ -0,0 +1,2 @@
#include "dwarfdump-test4-decl.h"
int d(){a();}

View File

@ -0,0 +1 @@
config.suffixes = []

View File

@ -1,28 +1,28 @@
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-inl-test.elf-x86-64 --address=0x613 \
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-inl-test.elf-x86-64 --address=0x710 \
RUN: --inlining --functions | FileCheck %s -check-prefix DEEP_STACK
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-inl-test.elf-x86-64 --address=0x6de \
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-inl-test.elf-x86-64 --address=0x7d1 \
RUN: --inlining | FileCheck %s -check-prefix SHORTER_STACK
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-inl-test.elf-x86-64 --address=0x685 \
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-inl-test.elf-x86-64 --address=0x785 \
RUN: --inlining | FileCheck %s -check-prefix SHORT_STACK
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-inl-test.elf-x86-64 --address=0x640 \
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-inl-test.elf-x86-64 --address=0x737 \
RUN: --functions | FileCheck %s -check-prefix INL_FUNC_NAME
DEEP_STACK: inlined_h
DEEP_STACK-NEXT: header.h:2:21
DEEP_STACK-NEXT: dwarfdump-inl-test.h:2
DEEP_STACK-NEXT: inlined_g
DEEP_STACK-NEXT: header.h:7
DEEP_STACK-NEXT: dwarfdump-inl-test.h:7
DEEP_STACK-NEXT: inlined_f
DEEP_STACK-NEXT: main.cc:3
DEEP_STACK-NEXT: dwarfdump-inl-test.cc:3
DEEP_STACK-NEXT: main
DEEP_STACK-NEXT: main.cc:8
DEEP_STACK-NEXT: dwarfdump-inl-test.cc:8
SHORTER_STACK: header.h:7:20
SHORTER_STACK-NEXT: main.cc:3
SHORTER_STACK-NEXT: main.cc:8
SHORTER_STACK: dwarfdump-inl-test.h:7
SHORTER_STACK-NEXT: dwarfdump-inl-test.cc:3
SHORTER_STACK-NEXT: dwarfdump-inl-test.cc:8
SHORT_STACK: main.cc:3:20
SHORT_STACK-NEXT: main.cc:8
SHORT_STACK: dwarfdump-inl-test.cc:3
SHORT_STACK-NEXT: dwarfdump-inl-test.cc:8
INL_FUNC_NAME: inlined_g
INL_FUNC_NAME-NEXT: header.h:7:20
INL_FUNC_NAME-NEXT: dwarfdump-inl-test.h:7

View File

@ -1,56 +1,56 @@
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 \
RUN: --address=0x400589 --functions | FileCheck %s -check-prefix MAIN
RUN: --address=0x400559 --functions | FileCheck %s -check-prefix MAIN
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 \
RUN: --address=0x400558 --functions | FileCheck %s -check-prefix FUNCTION
RUN: --address=0x400528 --functions | FileCheck %s -check-prefix FUNCTION
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test.elf-x86-64 \
RUN: --address=0x4005b6 --functions | FileCheck %s -check-prefix CTOR_WITH_SPEC
RUN: --address=0x400586 --functions | FileCheck %s -check-prefix CTOR_WITH_SPEC
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test2.elf-x86-64 \
RUN: --address=0x4004b8 --functions | FileCheck %s -check-prefix MANY_CU_1
RUN: --address=0x4004e8 --functions | FileCheck %s -check-prefix MANY_CU_1
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test2.elf-x86-64 \
RUN: --address=0x4004c4 --functions | FileCheck %s -check-prefix MANY_CU_2
RUN: --address=0x4004f4 --functions | FileCheck %s -check-prefix MANY_CU_2
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test3.elf-x86-64 \
RUN: --address=0x580 --functions | FileCheck %s -check-prefix ABS_ORIGIN_1
RUN: --address=0x640 --functions | FileCheck %s -check-prefix ABS_ORIGIN_1
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test3.elf-x86-64 \
RUN: --address=0x573 --functions | FileCheck %s -check-prefix INCLUDE_TEST_1
RUN: --address=0x633 --functions | FileCheck %s -check-prefix INCLUDE_TEST_1
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test3.elf-x86-64 \
RUN: --address=0x56d --functions | FileCheck %s -check-prefix INCLUDE_TEST_2
RUN: --address=0x62d --functions | FileCheck %s -check-prefix INCLUDE_TEST_2
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test4.elf-x86-64 \
RUN: --address=0x55c --functions \
RUN: --address=0x62c --functions \
RUN: | FileCheck %s -check-prefix MANY_SEQ_IN_LINE_TABLE
RUN: llvm-dwarfdump %p/Inputs/dwarfdump-test4.elf-x86-64 \
RUN: | FileCheck %s -check-prefix DEBUG_RANGES
MAIN: main
MAIN-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16:10
MAIN-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:16
FUNCTION: _Z1fii
FUNCTION-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11:18
FUNCTION-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:11
CTOR_WITH_SPEC: _ZN10DummyClassC1Ei
CTOR_WITH_SPEC-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4:30
CTOR_WITH_SPEC: DummyClass
CTOR_WITH_SPEC-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test.cc:4
MANY_CU_1: a
MANY_CU_1-NEXT: /tmp/dbginfo{{[/\\]}}a.cc:2:0
MANY_CU_1-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-helper.cc:2
MANY_CU_2: main
MANY_CU_2-NEXT: /tmp/dbginfo{{[/\\]}}main.cc:4:0
MANY_CU_2-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test2-main.cc:4
ABS_ORIGIN_1: C
ABS_ORIGIN_1-NEXT: /tmp/dbginfo{{[/\\]}}def2.cc:4:0
ABS_ORIGIN_1-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test3.cc:3
INCLUDE_TEST_1: _Z3do2v
INCLUDE_TEST_1-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}decl2.h:1:0
INCLUDE_TEST_1: _Z3do1v
INCLUDE_TEST_1-NEXT: /tmp/include{{[/\\]}}dwarfdump-test3-decl.h:7
INCLUDE_TEST_2: _Z3do1v
INCLUDE_TEST_2-NEXT: /tmp/include{{[/\\]}}decl.h:5:0
INCLUDE_TEST_2: _Z3do2v
INCLUDE_TEST_2-NEXT: /tmp/dbginfo{{[/\\]}}include{{[/\\]}}dwarfdump-test3-decl2.h:1
MANY_SEQ_IN_LINE_TABLE: _Z1cv
MANY_SEQ_IN_LINE_TABLE-NEXT: /tmp/dbginfo/sequences{{[/\\]}}c.cc:2:0
MANY_SEQ_IN_LINE_TABLE-NEXT: /tmp/dbginfo{{[/\\]}}dwarfdump-test4-part1.cc:2
DEBUG_RANGES: .debug_ranges contents:
DEBUG_RANGES-NEXT: 00000000 000000000000055c 0000000000000567
DEBUG_RANGES-NEXT: 00000000 0000000000000567 000000000000056d
DEBUG_RANGES-NEXT: 00000000 000000000000062c 0000000000000637
DEBUG_RANGES-NEXT: 00000000 0000000000000637 000000000000063d
DEBUG_RANGES-NEXT: 00000000 <End of list>
DEBUG_RANGES-NEXT: 00000030 0000000000000570 000000000000057b
DEBUG_RANGES-NEXT: 00000030 0000000000000567 000000000000056d
DEBUG_RANGES-NEXT: 00000030 0000000000000640 000000000000064b
DEBUG_RANGES-NEXT: 00000030 0000000000000637 000000000000063d
DEBUG_RANGES-NEXT: 00000030 <End of list>