summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEli Bendersky <eliben@gmail.com>2021-09-13 11:33:19 -0700
committerEli Bendersky <eliben@gmail.com>2021-09-13 11:33:19 -0700
commita1b5e46cf3015fe83c1f2a9de1a0e6d2fce76c19 (patch)
treed29680a50dab7eeda31d1512f081a5606e6415dd /tests
parentb249fc58e530f3dcbfc9a4c35f62e641a5d34757 (diff)
downloadpycparser-a1b5e46cf3015fe83c1f2a9de1a0e6d2fce76c19.tar.gz
Implement atomic specifiers like _Atomic(int*).
Based on #431 by vit9696 Updates #430
Diffstat (limited to 'tests')
-rwxr-xr-xtests/test_c_parser.py12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test_c_parser.py b/tests/test_c_parser.py
index 8c1ccc5..492cbd1 100755
--- a/tests/test_c_parser.py
+++ b/tests/test_c_parser.py
@@ -545,6 +545,18 @@ class TestCParser_fundamentals(TestCParser_base):
self.assertIsInstance(pdecl, PtrDecl)
self.assertEqual(pdecl.quals, ['const'])
+ def test_atomic_specifier(self):
+ self.assertEqual(self.get_decl('_Atomic(int) ai;'),
+ ['Decl',
+ ['_Atomic'],
+ 'ai',
+ ['TypeDecl', ['IdentifierType', ['int']]]])
+
+ self.assertEqual(self.get_decl('_Atomic(int*) ai;'),
+ ['Decl',
+ 'ai',
+ ['TypeDecl', ['PtrDecl', ['_Atomic'], ['IdentifierType', ['int']]]]])
+
def test_sizeof(self):
e = """
void foo()