diff options
author | Eli Bendersky <eliben@gmail.com> | 2021-09-13 11:33:19 -0700 |
---|---|---|
committer | Eli Bendersky <eliben@gmail.com> | 2021-09-13 11:33:19 -0700 |
commit | a1b5e46cf3015fe83c1f2a9de1a0e6d2fce76c19 (patch) | |
tree | d29680a50dab7eeda31d1512f081a5606e6415dd /tests | |
parent | b249fc58e530f3dcbfc9a4c35f62e641a5d34757 (diff) | |
download | pycparser-a1b5e46cf3015fe83c1f2a9de1a0e6d2fce76c19.tar.gz |
Implement atomic specifiers like _Atomic(int*).
Based on #431 by vit9696
Updates #430
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_c_parser.py | 12 |
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() |