summaryrefslogtreecommitdiffstats
path: root/clang/utils/ABITest/ABITestGen.py
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2010-09-27 20:13:19 +0000
committerDaniel Dunbar <daniel@zuster.org>2010-09-27 20:13:19 +0000
commit47dd9c2fc5773e1531100cec6aecf653aaf69459 (patch)
treeb92ad35d4f4d4c4552240ba5fa54dfe33ca334e0 /clang/utils/ABITest/ABITestGen.py
parent22ec2c218c474d09192cb8ac5c5c540b5a47fcc7 (diff)
downloadbcm5719-llvm-47dd9c2fc5773e1531100cec6aecf653aaf69459.tar.gz
bcm5719-llvm-47dd9c2fc5773e1531100cec6aecf653aaf69459.zip
utils/ABITest: Add a workaround for mismatches due to PR5579.
llvm-svn: 114865
Diffstat (limited to 'clang/utils/ABITest/ABITestGen.py')
-rwxr-xr-xclang/utils/ABITest/ABITestGen.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/clang/utils/ABITest/ABITestGen.py b/clang/utils/ABITest/ABITestGen.py
index 88dde269bd7..7543dffc913 100755
--- a/clang/utils/ABITest/ABITestGen.py
+++ b/clang/utils/ABITest/ABITestGen.py
@@ -263,6 +263,11 @@ class TypePrinter:
if output is None:
output = self.output
if isinstance(t, BuiltinType):
+ value_expr = name
+ if t.name.split(' ')[-1] == '_Bool':
+ # Hack to work around PR5579.
+ value_expr = "%s ? 2 : 0" % name
+
if t.name.endswith('long long'):
code = 'lld'
elif t.name.endswith('long'):
@@ -275,7 +280,8 @@ class TypePrinter:
code = 'Lf'
else:
code = 'p'
- print >>output, '%*sprintf("%s: %s = %%%s\\n", %s);'%(indent, '', prefix, name, code, name)
+ print >>output, '%*sprintf("%s: %s = %%%s\\n", %s);'%(
+ indent, '', prefix, name, code, value_expr)
elif isinstance(t, EnumType):
print >>output, '%*sprintf("%s: %s = %%d\\n", %s);'%(indent, '', prefix, name, name)
elif isinstance(t, RecordType):
OpenPOWER on IntegriCloud