Detect invalid section indexes when we first read them.
[oota-llvm.git] / test / DebugInfo / debuglineinfo.test
1 RUN: llvm-rtdyld -printline %p/Inputs/test-inline.o \
2 RUN:   | FileCheck %s -check-prefix TEST_INLINE
3 RUN: llvm-rtdyld -printdebugline %p/Inputs/test-inline.o \
4 RUN:   | FileCheck %s -check-prefix TEST_INLINE
5 RUN: llvm-rtdyld -printline %p/Inputs/test-parameters.o \
6 RUN:   | FileCheck %s -check-prefix TEST_PARAMETERS
7 RUN: llvm-rtdyld -printdebugline %p/Inputs/test-parameters.o \
8 RUN:   | FileCheck %s -check-prefix TEST_PARAMETERS
9
10 ; This test verifies that relocations are correctly applied to the
11 ; .debug_line section and exercises DIContext::getLineInfoForAddressRange().
12 ; If relocations are not applied the first two functions will be reported as
13 ; both starting at address zero in the; line number table.
14 TEST_INLINE:      Function: _Z15test_parametersPfPA2_dR11char_structPPitm, Size = 170
15 TEST_INLINE-NEXT: Line info @ 0: test-inline.cpp, line:33
16 TEST_INLINE-NEXT: Line info @ 35: test-inline.cpp, line:34
17 TEST_INLINE-NEXT: Line info @ 165: test-inline.cpp, line:35
18 TEST_INLINE-NEXT: Function: _Z3foov, Size = 3
19 TEST_INLINE-NEXT: Line info @ 0: test-inline.cpp, line:28
20 TEST_INLINE-NEXT: Line info @ 2: test-inline.cpp, line:29
21 TEST_INLINE-NEXT: Line info @ 3: test-inline.cpp, line:29
22 TEST_INLINE-NEXT: Function: main, Size = 146
23 TEST_INLINE-NEXT: Line info @ 0: test-inline.cpp, line:39
24 TEST_INLINE-NEXT: Line info @ 21: test-inline.cpp, line:41
25 TEST_INLINE-NEXT: Line info @ 39: test-inline.cpp, line:42
26 TEST_INLINE-NEXT: Line info @ 60: test-inline.cpp, line:44
27 TEST_INLINE-NEXT: Line info @ 80: test-inline.cpp, line:48
28 TEST_INLINE-NEXT: Line info @ 90: test-inline.cpp, line:45
29 TEST_INLINE-NEXT: Line info @ 95: test-inline.cpp, line:46
30 TEST_INLINE-NEXT: Line info @ 114: test-inline.cpp, line:48 
31 TEST_INLINE-NEXT: Line info @ 141: test-inline.cpp, line:49
32 TEST_INLINE-NEXT: Line info @ 146: test-inline.cpp, line:49
33
34 ; This test checks the case where all code is in a single section.
35 TEST_PARAMETERS:      Function: _Z15test_parametersPfPA2_dR11char_structPPitm, Size = 170
36 TEST_PARAMETERS-NEXT: Line info @ 0: test-parameters.cpp, line:33
37 TEST_PARAMETERS-NEXT: Line info @ 35: test-parameters.cpp, line:34
38 TEST_PARAMETERS-NEXT: Line info @ 165: test-parameters.cpp, line:35
39 TEST_PARAMETERS-NEXT: Function: _Z3foov, Size = 3
40 TEST_PARAMETERS-NEXT: Line info @ 0: test-parameters.cpp, line:28
41 TEST_PARAMETERS-NEXT: Line info @ 2: test-parameters.cpp, line:29
42 TEST_PARAMETERS-NEXT: Function: main, Size = 146
43 TEST_PARAMETERS-NEXT: Line info @ 0: test-parameters.cpp, line:39
44 TEST_PARAMETERS-NEXT: Line info @ 21: test-parameters.cpp, line:41
45 TEST_PARAMETERS-NEXT: Line info @ 39: test-parameters.cpp, line:42
46 TEST_PARAMETERS-NEXT: Line info @ 60: test-parameters.cpp, line:44
47 TEST_PARAMETERS-NEXT: Line info @ 80: test-parameters.cpp, line:48
48 TEST_PARAMETERS-NEXT: Line info @ 90: test-parameters.cpp, line:45
49 TEST_PARAMETERS-NEXT: Line info @ 95: test-parameters.cpp, line:46
50 TEST_PARAMETERS-NEXT: Line info @ 114: test-parameters.cpp, line:48 
51 TEST_PARAMETERS-NEXT: Line info @ 141: test-parameters.cpp, line:49
52 TEST_PARAMETERS-NEXT: Line info @ 146: test-parameters.cpp, line:49
53