Skip to content

[Debug Info] Fix debug info ptr to ptr test #95637

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 15, 2024

Conversation

huangjd
Copy link
Contributor

@huangjd huangjd commented Jun 15, 2024

Fix test case in #95298 because another recent submitted patch removed llvm.dbg intrinsics, updated test case accordingly

Fix test case in llvm#95298 because another recent submitted patch removed
llvm.dbg intrinsics, updated test case accordingly
@llvmbot llvmbot added the clang Clang issues not falling into any other category label Jun 15, 2024
@llvmbot
Copy link
Member

llvmbot commented Jun 15, 2024

@llvm/pr-subscribers-debuginfo

@llvm/pr-subscribers-clang

Author: William Junda Huang (huangjd)

Changes

Fix test case in #95298 because another recent submitted patch removed llvm.dbg intrinsics, updated test case accordingly


Full diff: https://github.com/llvm/llvm-project/pull/95637.diff

1 Files Affected:

  • (modified) clang/test/CodeGenCXX/debug-info-ptr-to-ptr.cpp (+14-14)
diff --git a/clang/test/CodeGenCXX/debug-info-ptr-to-ptr.cpp b/clang/test/CodeGenCXX/debug-info-ptr-to-ptr.cpp
index 51ce0f107b5e3..6975eae1fb122 100644
--- a/clang/test/CodeGenCXX/debug-info-ptr-to-ptr.cpp
+++ b/clang/test/CodeGenCXX/debug-info-ptr-to-ptr.cpp
@@ -25,7 +25,7 @@ class C {
 // CHECK-LABEL: define dso_local noundef i32 @{{.*}}func1{{.*}}(
 // CHECK:         [[A_ADDR:%.*]] = getelementptr inbounds %class.B, ptr {{%.*}}, i32 0, i32 0, !dbg [[DBG1:![0-9]+]]
 // CHECK-NEXT:    [[A:%.*]] = load ptr, ptr [[A_ADDR]], align {{.*}}, !dbg [[DBG1]]
-// CHECK-NEXT:    call void @llvm.dbg.value(metadata ptr [[A]], metadata [[META1:![0-9]+]], metadata !DIExpression()), !dbg [[DBG1]]
+// CHECK-NEXT:      #dbg_value(ptr [[A]], [[META1:![0-9]+]], !DIExpression(), [[DBG1]])
 // CHECK-NEXT:    {{%.*}} = getelementptr inbounds %class.A, ptr [[A]], i32 0, i32 0,
 int func1(B *b) {
   return b->a->i;
@@ -33,9 +33,9 @@ int func1(B *b) {
 
 // Should generate a pseudo variable when pointer is type-casted.
 // CHECK-LABEL: define dso_local noundef ptr @{{.*}}func2{{.*}}(
-// CHECK:         call void @llvm.dbg.declare(metadata ptr [[B_ADDR:%.*]], metadata [[META2:![0-9]+]], metadata !DIExpression())
+// CHECK:           #dbg_declare(ptr [[B_ADDR:%.*]], [[META2:![0-9]+]], !DIExpression(),
 // CHECK-NEXT:    [[B:%.*]] = load ptr, ptr [[B_ADDR]],
-// CHECK-NEXT:    call void @llvm.dbg.value(metadata ptr [[B]], metadata [[META3:![0-9]+]], metadata !DIExpression())
+// CHECK-NEXT:      #dbg_value(ptr [[B]], [[META3:![0-9]+]], !DIExpression(),
 // CHECK-NEXT:    {{%.*}} = getelementptr inbounds %class.B, ptr [[B]], i32 0,
 A* func2(void *b) {
   return ((B*)b)->a;
@@ -43,9 +43,9 @@ A* func2(void *b) {
 
 // Should not generate pseudo variable in this case.
 // CHECK-LABEL: define dso_local noundef i32 @{{.*}}func3{{.*}}(
-// CHECK:    call void @llvm.dbg.declare(metadata ptr [[B_ADDR:%.*]], metadata [[META4:![0-9]+]], metadata !DIExpression())
-// CHECK:    call void @llvm.dbg.declare(metadata ptr [[LOCAL1:%.*]], metadata [[META5:![0-9]+]], metadata !DIExpression())
-// CHECK-NOT: call void @llvm.dbg.value(metadata ptr
+// CHECK:      #dbg_declare(ptr [[B_ADDR:%.*]], [[META4:![0-9]+]], !DIExpression(),
+// CHECK:      #dbg_declare(ptr [[LOCAL1:%.*]], [[META5:![0-9]+]], !DIExpression(),
+// CHECK-NOT:  #dbg_value(ptr
 int func3(B *b) {
   A *local1 = b->a;
   return local1->i;
@@ -54,10 +54,10 @@ int func3(B *b) {
 // CHECK-LABEL: define dso_local noundef signext i8 @{{.*}}func4{{.*}}(
 // CHECK:         [[A_ADDR:%.*]] = getelementptr inbounds %class.C, ptr {{%.*}}, i32 0, i32 1
 // CHECK-NEXT:    [[A:%.*]] = load ptr, ptr [[A_ADDR]],
-// CHECK-NEXT:    call void @llvm.dbg.value(metadata ptr [[A]], metadata [[META6:![0-9]+]], metadata !DIExpression())
+// CHECK-NEXT:      #dbg_value(ptr [[A]], [[META6:![0-9]+]], !DIExpression(),
 // CHECK-NEXT:    {{%.*}} = getelementptr inbounds %class.A, ptr [[A]], i32 0, i32 0,
 // CHECK:         [[CALL:%.*]] = call noundef ptr @{{.*}}foo{{.*}}(
-// CHECK-NEXT:    call void @llvm.dbg.value(metadata ptr [[CALL]], metadata [[META6]], metadata !DIExpression())
+// CHECK-NEXT:      #dbg_value(ptr [[CALL]], [[META6]], !DIExpression(),
 // CHECK-NEXT:    [[I1:%.*]] = getelementptr inbounds %class.A, ptr [[CALL]], i32 0, i32 1
 char func4(C *c) {
   extern A* foo(int x);
@@ -65,25 +65,25 @@ char func4(C *c) {
 }
 
 // CHECK-LABEL: define dso_local noundef signext i8 @{{.*}}func5{{.*}}(
-// CHECK:         call void @llvm.dbg.declare(metadata ptr {{%.*}}, metadata [[META7:![0-9]+]], metadata !DIExpression())
-// CHECK:         call void @llvm.dbg.declare(metadata ptr {{%.*}}, metadata [[META8:![0-9]+]], metadata !DIExpression())
+// CHECK:           #dbg_declare(ptr {{%.*}}, [[META7:![0-9]+]], !DIExpression(),
+// CHECK:           #dbg_declare(ptr {{%.*}}, [[META8:![0-9]+]], !DIExpression(),
 // CHECK:         [[A_ADDR:%.*]] = getelementptr inbounds %class.A, ptr {{%.*}}, i64 {{%.*}},
-// CHECK-NEXT:    call void @llvm.dbg.value(metadata ptr [[A_ADDR]], metadata [[META9:![0-9]+]], metadata !DIExpression())
+// CHECK-NEXT:      #dbg_value(ptr [[A_ADDR]], [[META9:![0-9]+]], !DIExpression(),
 // CHECK-NEXT:    {{%.*}} = getelementptr inbounds %class.A, ptr [[A_ADDR]], i32 0, i32 1,
 char func5(void *arr, int n) {
   return ((A*)arr)[n].c;
 }
 
 // CHECK-LABEL: define dso_local noundef i32 @{{.*}}func6{{.*}}(
-// CHECK:         call void @llvm.dbg.declare(metadata ptr {{%.*}}, metadata [[META10:![0-9]+]], metadata !DIExpression())
-// CHECK:         call void @llvm.dbg.value(metadata ptr {{%.*}}, metadata [[META11:![0-9]+]], metadata !DIExpression())
+// CHECK:           #dbg_declare(ptr {{%.*}}, [[META10:![0-9]+]], !DIExpression(),
+// CHECK:           #dbg_value(ptr {{%.*}}, [[META11:![0-9]+]], !DIExpression(),
 int func6(B &b) {
   return reinterpret_cast<A&>(b).i;
 }
 
 // CHECK-LABEL: define dso_local noundef i32 @{{.*}}global{{.*}}(
 // CHECK:         [[GA:%.*]] = load ptr, ptr @ga
-// CHECK-NEXT:    call void @llvm.dbg.value(metadata ptr [[GA]], metadata [[META12:![0-9]+]], metadata !DIExpression())
+// CHECK-NEXT:      #dbg_value(ptr [[GA]], [[META12:![0-9]+]], !DIExpression(),
 A *ga;
 int global() {
   return ga->i;

Copy link
Member

@jmorse jmorse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jayfoad
Copy link
Contributor

jayfoad commented Jun 15, 2024

I'll merge to fix the build.

@jayfoad jayfoad merged commit 47f8b85 into llvm:main Jun 15, 2024
10 checks passed
@huangjd huangjd deleted the FixDebugInfoPtrToPtrTest branch June 17, 2024 07:42
@jmorse
Copy link
Member

jmorse commented Jun 17, 2024

@huangjd Thanks for the fix -- FYI it's acceptable to commit patches like this without review (and leave a comment on the original PR) if you wanted to. Given that it's just the format of the test changing, not any of the meaning, it's an "obvious" fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clang Clang issues not falling into any other category debuginfo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants