-
Notifications
You must be signed in to change notification settings - Fork 137
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DebugInfo][test] Fix tests for LLVM 19 compatibility
Upstream LLVM has eliminated debug intrinsics like @llvm.dbg.value() and @llvm.dbg.declare(), and replaced them with DPValue objects that are printed as #dbg_value() and #dbg_declare(). This patch modifies the FileCheck patterns in the tests to match, and make them require the "llvm-19" feature.
- Loading branch information
Showing
17 changed files
with
261 additions
and
177 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
!RUN: %flang -g -S -emit-llvm %s -o - | FileCheck %s | ||
! Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
! See https://llvm.org/LICENSE.txt for license information. | ||
! SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
|
||
!Verify the IR contains _V_ (flang)convention naming and the | ||
! operation using them are well formed. | ||
!CHECK: sub_(i32 [[PREFIXED_ARG_NAME:%_V_arg_abc.arg]]) | ||
!CHECK: [[PREFIXED_LOCAL_NAME:%_V_arg_abc.addr]] = alloca i32, align 4 | ||
!CHECK: call void @llvm.dbg.declare(metadata ptr [[PREFIXED_LOCAL_NAME]] | ||
!CHECK: store i32 [[PREFIXED_ARG_NAME]], ptr [[PREFIXED_LOCAL_NAME]], align 4 | ||
! REQUIRES: llvm-19 | ||
! RUN: %flang -g -S -emit-llvm %s -o - | FileCheck %s | ||
|
||
!Verify the DebugInfo metadata contains prefix _V_ truncated names. | ||
!CHECK: DILocalVariable(name: "arg_abc" | ||
!CHECK-NOT: DILocalVariable(name: "_V_arg_abc" | ||
! Verify that the IR contains "_V_" (Flang's naming convention for byval | ||
! parameters) and that the operation using them are well-formed. | ||
|
||
! CHECK: sub_(i32 [[PREFIXED_ARG_NAME:%_V_arg_abc.arg]]) | ||
! CHECK: [[PREFIXED_LOCAL_NAME:%_V_arg_abc.addr]] = alloca i32, align 4 | ||
! CHECK: #dbg_declare(ptr [[PREFIXED_LOCAL_NAME]] | ||
! CHECK: store i32 [[PREFIXED_ARG_NAME]], ptr [[PREFIXED_LOCAL_NAME]], align 4 | ||
|
||
! Verify that the names in the DebugInfo metadata have dropped the "_V_" prefix. | ||
|
||
! CHECK-NOT: DILocalVariable(name: "_V_arg_abc" | ||
! CHECK-COUNT-2: DILocalVariable(name: "arg_abc" | ||
! CHECK-NOT: DILocalVariable(name: "_V_arg_abc" | ||
|
||
subroutine sub(arg_abc) | ||
integer,value :: arg_abc | ||
integer :: abc_local | ||
abc_local = arg_abc | ||
print*, arg_abc | ||
integer, value :: arg_abc | ||
integer :: abc_local | ||
abc_local = arg_abc | ||
print *, arg_abc | ||
end subroutine |
Oops, something went wrong.