|
| 1 | +; RUN: opt -passes=debugify --debugify-atoms -S -o - < %s \ |
| 2 | +; RUN: | FileCheck %s |
| 3 | + |
| 4 | +;; Mirrors llvm/test/DebugInfo/debugify.ll. Split out here because the |
| 5 | +;; test is only supported if LLVM_EXPERIMENTAL_KEY_INSTRUCTIONS is enabled |
| 6 | +;; (which is a condition for running this test directory). Once the conditional |
| 7 | +;; compilation of the feature is removed this can be merged into the original. |
| 8 | + |
| 9 | +; CHECK-LABEL: define void @foo |
| 10 | +define void @foo() { |
| 11 | +; CHECK: ret void, !dbg ![[RET1:.*]] |
| 12 | + ret void |
| 13 | +} |
| 14 | + |
| 15 | +; CHECK-LABEL: define i32 @bar |
| 16 | +define i32 @bar() { |
| 17 | +; CHECK: call void @foo(), !dbg ![[CALL1:.*]] |
| 18 | + call void @foo() |
| 19 | + |
| 20 | +; CHECK: add i32 0, 1, !dbg ![[ADD1:.*]] |
| 21 | + %sum = add i32 0, 1 |
| 22 | + |
| 23 | +; CHECK: ret i32 0, !dbg ![[RET2:.*]] |
| 24 | + ret i32 0 |
| 25 | +} |
| 26 | + |
| 27 | +; CHECK-LABEL: define weak_odr zeroext i1 @baz |
| 28 | +define weak_odr zeroext i1 @baz() { |
| 29 | +; CHECK-NOT: !dbg |
| 30 | + ret i1 false |
| 31 | +} |
| 32 | + |
| 33 | +; CHECK-LABEL: define i32 @boom |
| 34 | +define i32 @boom() { |
| 35 | +; CHECK: [[result:%.*]] = musttail call i32 @bar(), !dbg ![[musttail:.*]] |
| 36 | + %retval = musttail call i32 @bar() |
| 37 | +; CHECK-NEXT: ret i32 [[result]], !dbg ![[musttailRes:.*]] |
| 38 | + ret i32 %retval |
| 39 | +} |
| 40 | + |
| 41 | +; CHECK-DAG: ![[RET1]] = !DILocation(line: 1, {{.*}}, atomGroup: 1, atomRank: 1 |
| 42 | +; CHECK-DAG: ![[CALL1]] = !DILocation(line: 2, {{.*}}, atomGroup: 2, atomRank: 1 |
| 43 | +; CHECK-DAG: ![[ADD1]] = !DILocation(line: 3, {{.*}}, atomGroup: 3, atomRank: 1 |
| 44 | +; CHECK-DAG: ![[RET2]] = !DILocation(line: 4, {{.*}}, atomGroup: 4, atomRank: 1 |
| 45 | +; CHECK-DAG: ![[musttail]] = !DILocation(line: 5, {{.*}}, atomGroup: 5, atomRank: 1 |
| 46 | +; CHECK-DAG: ![[musttailRes]] = !DILocation(line: 6, {{.*}}, atomGroup: 6, atomRank: 1 |
0 commit comments