]> granicus.if.org Git - clang/commitdiff
ABITest: Fix access to array test values.
authorDaniel Dunbar <daniel@zuster.org>
Thu, 29 Jan 2009 08:48:06 +0000 (08:48 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Thu, 29 Jan 2009 08:48:06 +0000 (08:48 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@63296 91177308-0d34-0410-b5e6-96231b3b80d8

utils/ABITest/ABITestGen.py

index 5b9756b545090630a85daee554f8c42e8ae6bbf4..bdf0be4f1d90aa20e8aff4f014eba9e2564ab15a 100755 (executable)
@@ -263,7 +263,10 @@ class TypePrinter:
             for i in range(t.numElements):
                 # Access in this fashion as a hackish way to portably
                 # access vectors.
-                self.printValueOfType(prefix, '((%s*) &%s)[%d]'%(t.elementType,name,i), t.elementType, output=output,indent=indent)                            
+                if t.isVector:
+                    self.printValueOfType(prefix, '((%s*) &%s)[%d]'%(t.elementType,name,i), t.elementType, output=output,indent=indent)
+                else:
+                    self.printValueOfType(prefix, '%s[%d]'%(name,i), t.elementType, output=output,indent=indent)                    
         else:
             raise NotImplementedError,'Cannot print value of type: "%s"'%(t,)