[clang] [libclang/python] Improve test coverage (PR #109846)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Tue Sep 24 13:24:48 PDT 2024
================
@@ -625,6 +762,25 @@ def test_result_type_objc_method_decl(self):
self.assertEqual(cursor.kind, CursorKind.OBJC_INSTANCE_METHOD_DECL)
self.assertEqual(result_type.kind, TypeKind.VOID)
+ def test_storage_class(self):
+ tu = get_tu(
+ """
+extern int ex;
+register int reg;
+int count(int a, int b){
+ static int counter = 0;
+ return 0;
+}
+""",
+ lang="cpp",
+ )
+ cursor = get_cursor(tu, "ex")
+ self.assertEqual(cursor.storage_class, StorageClass.EXTERN)
+ cursor = get_cursor(tu, "counter")
+ self.assertEqual(cursor.storage_class, StorageClass.STATIC)
+ cursor = get_cursor(tu, "reg")
+ self.assertEqual(cursor.storage_class, StorageClass.REGISTER)
+
----------------
Endilll wrote:
I agree that it doesn't seem to be necessary.
https://github.com/llvm/llvm-project/pull/109846
More information about the cfe-commits
mailing list