зеркало из https://github.com/microsoft/clang-1.git
ABITest: Fix test value generation for unions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63286 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Родитель
b0e14f2a87
Коммит
900ed55727
|
@ -193,9 +193,16 @@ class TypePrinter:
|
|||
yield '(%s) -1'%(t.name,)
|
||||
yield '(%s) 1'%(t.name,)
|
||||
elif isinstance(t, RecordType):
|
||||
fieldValues = [list(self.getTestValues(f)) for f in t.fields]
|
||||
if not t.fields:
|
||||
yield '{ }'
|
||||
return
|
||||
# FIXME: Use designated initializers to access non-first
|
||||
# fields of unions.
|
||||
if t.isUnion:
|
||||
for v in self.getTestValues(t.fields[0]):
|
||||
yield '{ %s }' % v
|
||||
return
|
||||
fieldValues = [list(self.getTestValues(f)) for f in t.fields]
|
||||
for i,values in enumerate(fieldValues):
|
||||
for v in values:
|
||||
elements = map(random.choice,fieldValues)
|
||||
|
|
Загрузка…
Ссылка в новой задаче