]> granicus.if.org Git - clang/commitdiff
utils/ABITest: Add a workaround for mismatches due to PR5579.
authorDaniel Dunbar <daniel@zuster.org>
Mon, 27 Sep 2010 20:13:19 +0000 (20:13 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Mon, 27 Sep 2010 20:13:19 +0000 (20:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@114865 91177308-0d34-0410-b5e6-96231b3b80d8

utils/ABITest/ABITestGen.py

index 88dde269bd7148dd0ba6e92c18005d590bb12ffe..7543dffc913313298ded3f70cc9cfe1c292c9d4a 100755 (executable)
@@ -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):