[clang] [clang][DebugInfo][test] Convert Objective-C property2.m test to check LLVM IR (PR #165297)
Michael Buch via cfe-commits
cfe-commits at lists.llvm.org
Mon Oct 27 12:14:14 PDT 2025
https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/165297
>From 65e4b365a050ba3b9125e8dbe806a25bdd1c350f Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Mon, 27 Oct 2025 17:30:21 +0000
Subject: [PATCH 1/2] [clang][DebugInfo][test] Convert Objective-C property
test to check LLVM IR
There's a couple of tests like this.
This patch series renames these to something more descriptive and adjusts the tests to check IR. Currently the tests check raw assembly output (not even dwarfdump). Which most likely hid some bugs around property debug-info.
---
clang/test/DebugInfo/ObjC/property-basic.m | 20 ++++++++++++++++++++
clang/test/DebugInfo/ObjC/property.m | 15 ---------------
2 files changed, 20 insertions(+), 15 deletions(-)
create mode 100644 clang/test/DebugInfo/ObjC/property-basic.m
delete mode 100644 clang/test/DebugInfo/ObjC/property.m
diff --git a/clang/test/DebugInfo/ObjC/property-basic.m b/clang/test/DebugInfo/ObjC/property-basic.m
new file mode 100644
index 0000000000000..65e1d7a6a9b1f
--- /dev/null
+++ b/clang/test/DebugInfo/ObjC/property-basic.m
@@ -0,0 +1,20 @@
+// Checks basic debug-info generation for property. Makes sure we
+// create a DIObjCProperty for the synthesized property.
+
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
+
+// CHECK: !DIObjCProperty(name: "p1"
+// CHECK-SAME: attributes: 2316
+// CHECK-SAME: type: ![[P1_TYPE:[0-9]+]]
+//
+// CHECK: ![[P1_TYPE]] = !DIBasicType(name: "int"
+
+ at interface I1 {
+int p1;
+}
+ at property int p1;
+ at end
+
+ at implementation I1
+ at synthesize p1;
+ at end
diff --git a/clang/test/DebugInfo/ObjC/property.m b/clang/test/DebugInfo/ObjC/property.m
deleted file mode 100644
index ca013b24be421..0000000000000
--- a/clang/test/DebugInfo/ObjC/property.m
+++ /dev/null
@@ -1,15 +0,0 @@
-// FIXME: Check IR rather than asm, then triple is not needed.
-// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s
-
-// CHECK: AT_APPLE_property_name
-// CHECK: AT_APPLE_property_attribute
-// CHECK: AT_APPLE_property
- at interface I1 {
-int p1;
-}
- at property int p1;
- at end
-
- at implementation I1
- at synthesize p1;
- at end
>From 95b3671952e0e00d8847f1574a87389a32f53a0d Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Mon, 27 Oct 2025 19:05:38 +0000
Subject: [PATCH 2/2] [clang][DebugInfo][test] Convert Objective-C property2.m
test to check LLVM IR
This patch series renames these Objective-C property tests to something more descriptive and adjusts them to check IR. Currently the tests check raw assembly output (not even dwarfdump). Which most likely hid some bugs around property debug-info.
---
.../DebugInfo/ObjC/property-explicit-ivar.m | 22 +++++++++++++++++++
clang/test/DebugInfo/ObjC/property2.m | 15 -------------
2 files changed, 22 insertions(+), 15 deletions(-)
create mode 100644 clang/test/DebugInfo/ObjC/property-explicit-ivar.m
delete mode 100644 clang/test/DebugInfo/ObjC/property2.m
diff --git a/clang/test/DebugInfo/ObjC/property-explicit-ivar.m b/clang/test/DebugInfo/ObjC/property-explicit-ivar.m
new file mode 100644
index 0000000000000..5092e23e195f8
--- /dev/null
+++ b/clang/test/DebugInfo/ObjC/property-explicit-ivar.m
@@ -0,0 +1,22 @@
+// RUN: %clang_cc1 -emit-llvm -debug-info-kind=limited %s -o - | FileCheck %s
+
+// CHECK: ![[BASE_PROP:[0-9]+]] = !DIObjCProperty(name: "base"
+// CHECK-SAME: attributes: 2316
+// CHECK-SAME: type: ![[P1_TYPE:[0-9]+]]
+//
+// CHECK: ![[P1_TYPE]] = !DIBasicType(name: "int"
+//
+// CHECK: !DIDerivedType(tag: DW_TAG_member, name: "_customIvar"
+// CHECK-SAME: extraData: ![[BASE_PROP]]
+
+ at interface C {
+ int _customIvar;
+}
+ at property int base;
+ at end
+
+ at implementation C
+ at synthesize base = _customIvar;
+ at end
+
+void foo(C *cptr) {}
diff --git a/clang/test/DebugInfo/ObjC/property2.m b/clang/test/DebugInfo/ObjC/property2.m
deleted file mode 100644
index 7e0a5e9f954ba..0000000000000
--- a/clang/test/DebugInfo/ObjC/property2.m
+++ /dev/null
@@ -1,15 +0,0 @@
-// FIXME: Check IR rather than asm, then triple is not needed.
-// RUN: %clang_cc1 -triple %itanium_abi_triple -S -debug-info-kind=limited %s -o - | FileCheck %s
-
-// CHECK: AT_APPLE_property_name
- at interface C {
- int _base;
-}
- at property int base;
- at end
-
- at implementation C
- at synthesize base = _base;
- at end
-
-void foo(C *cptr) {}
More information about the cfe-commits
mailing list