diff options
| author | Rafael Espindola <rafael.espindola@gmail.com> | 2015-01-29 17:22:53 +0000 |
|---|---|---|
| committer | Rafael Espindola <rafael.espindola@gmail.com> | 2015-01-29 17:22:53 +0000 |
| commit | 3c5f2354b8655bd56f4fbfb3a6a862bd14cb3f3f (patch) | |
| tree | 0ce5914fa3179fe142febd2a7cf33b1b46c09fc6 /clang/bindings/python/tests/cindex | |
| parent | 50a20c0e42a97bfd394ad6e71b3ef10bc0ca4063 (diff) | |
| download | bcm5719-llvm-3c5f2354b8655bd56f4fbfb3a6a862bd14cb3f3f.tar.gz bcm5719-llvm-3c5f2354b8655bd56f4fbfb3a6a862bd14cb3f3f.zip | |
This reverts commit r227432, r227438 and r227448.
It should bring the bots back.
Original messagses:
r227448:
Remove unnecessary default.
r227438:
Fix Index/print-type.cpp test following r227432.
r227432:
libclang: Add three functions useful for dealing with anonymous fields:
clang_Cursor_getOffsetOfField
clang_Cursor_isAnonymous
clang_Type_visitFields
Python: Add corresponding methods for dealing with anonymous fields.
Patch by Loïc Jaquemet
llvm-svn: 227472
Diffstat (limited to 'clang/bindings/python/tests/cindex')
| -rw-r--r-- | clang/bindings/python/tests/cindex/test_type.py | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/clang/bindings/python/tests/cindex/test_type.py b/clang/bindings/python/tests/cindex/test_type.py index f3dadf999bd..a02c06fe5a1 100644 --- a/clang/bindings/python/tests/cindex/test_type.py +++ b/clang/bindings/python/tests/cindex/test_type.py @@ -363,7 +363,6 @@ def test_offset(): """Ensure Cursor.get_record_field_offset works in anonymous records""" source=""" struct Test { - struct {int a;} typeanon; struct { int bariton; union { @@ -372,23 +371,15 @@ struct Test { }; int bar; };""" - tries=[(['-target','i386-linux-gnu'],(4,16,0,32,64,96)), - (['-target','nvptx64-unknown-unknown'],(8,24,0,32,64,96)), - (['-target','i386-pc-win32'],(8,16,0,32,64,96)), - (['-target','msp430-none-none'],(2,14,0,32,64,96))] + tries=[(['-target','i386-linux-gnu'],(4,16,0,32,64)), + (['-target','nvptx64-unknown-unknown'],(8,24,0,32,64)), + (['-target','i386-pc-win32'],(8,16,0,32,64)), + (['-target','msp430-none-none'],(2,14,0,32,64))] for flags, values in tries: - align,total,f1,bariton,foo,bar = values + align,total,bariton,foo,bar = values tu = get_tu(source) teststruct = get_cursor(tu, 'Test') - children = list(teststruct.get_children()) - fields = list(teststruct.type.get_fields()) - assert children[0].kind == CursorKind.STRUCT_DECL - assert children[0].spelling != "typeanon" - assert children[1].spelling == "typeanon" - assert fields[0].kind == CursorKind.FIELD_DECL - assert fields[1].kind == CursorKind.FIELD_DECL - assert fields[1].is_anonymous() - assert teststruct.type.get_offset("typeanon") == f1 + fields = list(teststruct.get_children()) assert teststruct.type.get_offset("bariton") == bariton assert teststruct.type.get_offset("foo") == foo assert teststruct.type.get_offset("bar") == bar |

