Skip to content

Commit 89d18e2

Browse files
committed
Add tests that trigger DWARF4 vs DWARF5 bug explicitly
1 parent 18c8d04 commit 89d18e2

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#include <cstdio>
2+
3+
extern "C" void foo() { printf("Hello from second CU!\n"); }
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Check that BOLT correctly generates debug line comments for DWARF-5.
2+
3+
// REQUIRES: system-linux
4+
5+
// RUN: %clang -g -gdwarf-5 -O0 -xc++ %s -o %t.exe
6+
// RUN: llvm-bolt %t.exe --update-debug-sections --print-debug-info \
7+
// RUN: --print-after-lowering -o %t.bolt | FileCheck %s
8+
9+
// CHECK: pushq %rbp # debug line {{.*}}dwarf5-debug-line-print.test:11
10+
11+
int main(){
12+
int x = 0;
13+
return 0;
14+
}

bolt/test/X86/dwarf5-two-cus.test

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Check that BOLT correctly handles two CUs with DWARF-5 debug info (does not crash).
2+
3+
// REQUIRES: system-linux
4+
5+
// RUN: %clang -g -gdwarf-5 -O1 -xc++ %s -o %t-main.o -c
6+
// RUN: %clang -g -gdwarf-5 -O1 -xc++ %S/Inputs/dwarf5-two-cus-foo.cpp -o %t-foo.o -c
7+
// RUN: %clang %t-main.o %t-foo.o -o %t.exe
8+
// RUN: llvm-bolt %t.exe --update-debug-sections --force-inline=foo \
9+
// RUN: -o %t.bolt | FileCheck %s
10+
11+
// CHECK-NOT: BOLT-ERROR
12+
// CHECK-NOT: BOLT-WARNING
13+
// CHECK: BOLT-INFO: inlined {{[0-9]+}} calls at {{[1-9][0-9]*}} call sites
14+
15+
extern "C" void foo();
16+
17+
int main() {
18+
foo();
19+
return 0;
20+
}

0 commit comments

Comments
 (0)