Skip to content

Commit 03b4ce3

Browse files
committed
Add test case
1 parent bc96976 commit 03b4ce3

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

llvm/test/Transforms/Coroutines/coro-split-dbg-labels.ll

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
; Tests that we add DILabels for the suspend points.
22
;
3-
; We check both the generated LLVM:
3+
; Check the generated LLVM:
44
; RUN: opt < %s -passes='cgscc(coro-split)' -S | FileCheck %s
55
;
6-
; And the debug info:
6+
; Check the generated DWARF debug info:
77
; REQUIRES: object-emission
88
; RUN: opt < %s -passes='cgscc(coro-split),coro-cleanup' \
99
; RUN: | %llc_dwarf -O0 -filetype=obj -o - \
1010
; RUN: | llvm-dwarfdump - \
1111
; RUN: | FileCheck %s -check-prefix=DWARF
12+
;
13+
; Check that we don't emit any DILabel if in `LineTablesOnly` mode
14+
; RUN: sed -e 's/emissionKind: FullDebug/emissionKind: LineTablesOnly/' %s \
15+
; RUN: | opt -passes='cgscc(coro-split)' -S \
16+
; RUN: | FileCheck %s -check-prefix=LINE-TABLE
1217

1318
source_filename = "coro.c"
1419

@@ -83,6 +88,12 @@ coro_Suspend: ; preds = %for.cond, %if.then,
8388
; CHECK: ![[DESTROY_0]] = !DILabel(scope: !{{[0-9]+}}, name: "__coro_resume_0", file: !{{[0-9]*}}, line: 12, column: 6, isArtificial: true, coroSuspendIdx: 0)
8489
; CHECK: ![[DESTROY_1]] = !DILabel(scope: !{{[0-9]+}}, name: "__coro_resume_1", file: !{{[0-9]*}}, line: 14, column: 6, isArtificial: true, coroSuspendIdx: 1)
8590

91+
; Check the we do not emit any DILabels in LineTableOnly mode.
92+
; The DWARF emitter cannot handle this and would run into an assertion
93+
; LINE-TABLE: !DICompileUnit{{.*}}LineTablesOnly
94+
; LINE-TABLE-NOT: DILabel
95+
96+
8697
; DWARF: {{.*}}DW_TAG_label
8798
; DWARF-NEXT: DW_AT_name ("__coro_resume_0")
8899
; DWARF-NEXT: DW_AT_decl_file

0 commit comments

Comments
 (0)