| 1 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c++ -std=c++17 %s -debug-info-kind=line-tables-only -emit-llvm -o - -gno-column-info \ |
| 2 |
// RUN: | FileCheck %s |
| 3 |
// RUN: %clang_cc1 -triple x86_64-linux-gnu -gkey-instructions -x c %s -debug-info-kind=line-tables-only -emit-llvm -o - -gno-column-info \ |
| 4 |
// RUN: | FileCheck %s |
| 5 |
|
| 6 |
// Check the goto branches get Key Instructions metadata. |
| 7 |
void ext(); |
| 8 |
void test_goto(void) { |
| 9 |
// CHECK: br label %dst1, !dbg [[G1R1:!.*]] |
| 10 |
goto dst1; |
| 11 |
dst1: |
| 12 |
ext(); |
| 13 |
|
| 14 |
void *ptr = &&dst2; |
| 15 |
// CHECK: br label %indirectgoto, !dbg [[G3R1:!.*]] |
| 16 |
goto *ptr; |
| 17 |
dst2: |
| 18 |
ext(); |
| 19 |
|
| 20 |
// CHECK: br label %dst3, !dbg [[G4R1:!.*]] |
| 21 |
goto *&&dst3; |
| 22 |
dst3: |
| 23 |
ext(); |
| 24 |
|
| 25 |
return; |
| 26 |
} |
| 27 |
|
| 28 |
// CHECK: [[G1R1]] = !DILocation(line: 10, scope: ![[#]], atomGroup: 1, atomRank: 1) |
| 29 |
// CHECK: [[G3R1]] = !DILocation(line: 16, scope: ![[#]], atomGroup: 3, atomRank: 1) |
| 30 |
// CHECK: [[G4R1]] = !DILocation(line: 21, scope: ![[#]], atomGroup: 4, atomRank: 1) |