[llvm-commits] [llvm-gcc-4.2] r54301 - in /llvm-gcc-4.2/trunk/gcc/testsuite: g++.apple/5591491.C g++.dg/align-test-1.C

Bill Wendling isanbard at gmail.com
Sat Aug 2 21:25:56 PDT 2008


Author: void
Date: Sat Aug  2 23:25:55 2008
New Revision: 54301

URL: http://llvm.org/viewvc/llvm-project?rev=54301&view=rev
Log:
Add ARM support.

Modified:
    llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/5591491.C
    llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/align-test-1.C

Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/5591491.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.apple/5591491.C?rev=54301&r1=54300&r2=54301&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/5591491.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.apple/5591491.C Sat Aug  2 23:25:55 2008
@@ -28,3 +28,4 @@
 
  v1->f4.f2 = v3.f2;
 }
+

Modified: llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/align-test-1.C
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/testsuite/g%2B%2B.dg/align-test-1.C?rev=54301&r1=54300&r2=54301&view=diff

==============================================================================
--- llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/align-test-1.C (original)
+++ llvm-gcc-4.2/trunk/gcc/testsuite/g++.dg/align-test-1.C Sat Aug  2 23:25:55 2008
@@ -196,14 +196,17 @@
 } B2;
 
 
+/* APPLE LOCAL begin ARM alignments */
 /* APPLE LOCAL begin radar 4869885 */
 static void check(const char * rec_name, int actual, int expected32, int expected64, 
-		  int expected_ia32, const char * comment)
+		  int expected_ia32, int expected_arm, const char * comment)
 /* APPLE LOCAL end radar 4869885 */
 {
     int expected;
 #ifdef __i386__
     expected = expected_ia32;
+#elif defined (__arm__)
+    expected = expected_arm;
 #else
     expected = ((sizeof(char *) == 8) ? expected64 : expected32);
 #endif
@@ -217,6 +220,7 @@
         printf(": %s\n", comment);
     }
 }
+/* APPLE LOCAL end ARM alignments */
 
 static void check_option(char *option)
 {
@@ -233,6 +237,7 @@
     }
 }
 
+/* APPLE LOCAL begin ARM alignments */
 int main(int argc, char *argv[])
 {
     int i;
@@ -243,55 +248,56 @@
     if (bad_option)
         return 1;
 
-    check(Q(sizeof(C1)), 1, 1, 1, "const as 1st field");
-    check(Q(sizeof(C2)), 1, 1, 1, "static as 1st field");
-    check(Q(sizeof(C3)), 1, 1, 1, "enum as 1st field");
-    check(Q(sizeof(C4)), 1, 1, 1, "const as 2nd field");
-    check(Q(sizeof(C5)), 1, 1, 1, "static as 2nd field");
-    check(Q(sizeof(C6)), 1, 1, 1, "enum as 2nd field");
-    check(Q(sizeof(C7)), 1, 1, 1, "empty class, power mode");
+    check(Q(sizeof(C1)), 1, 1, 1, 1, "const as 1st field");
+    check(Q(sizeof(C2)), 1, 1, 1, 1, "static as 1st field");
+    check(Q(sizeof(C3)), 1, 1, 1, 1, "enum as 1st field");
+    check(Q(sizeof(C4)), 1, 1, 1, 1, "const as 2nd field");
+    check(Q(sizeof(C5)), 1, 1, 1, 1, "static as 2nd field");
+    check(Q(sizeof(C6)), 1, 1, 1, 1, "enum as 2nd field");
+    check(Q(sizeof(C7)), 1, 1, 1, 1, "empty class, power mode");
 #ifndef __LP64__
-    check(Q(sizeof(C8)), 2, 2, 2, "empty class, mac68k mode");
-    check(Q(sizeof(C9)), 2, 2, 2, "class with empty base class and one char, mac68k");
-    check(Q(offsetof(C9, f1)), 0, 0, 0, "offset of 1st field after empty base class");
+    check(Q(sizeof(C8)), 2, 2, 2, 1, "empty class, mac68k mode");
+    check(Q(sizeof(C9)), 2, 2, 2, 1, "class with empty base class and one char, mac68k");
+    check(Q(offsetof(C9, f1)), 0, 0, 0, 0, "offset of 1st field after empty base class");
 #endif
-    check(Q(sizeof(C10)), 1, 1, 1, "class based on an empty class, power mode");
-    check(Q(sizeof(C11)), 8, 16, 8, "class with long, char");
-    check(Q(sizeof(C12)), 12, 24, 12, "class with base class with long, char and its own char");
-    check(Q(offsetof(C12, f3)), 8, 16, 8, "offset of 1st field in class with a base class with a long, char");
-    check(Q(sizeof(C13)), 8, 16, 8, "class with long, short");
-    check(Q(sizeof(C14)), 16, 32, 16, "derived class with short, long");
-    check(Q(offsetof(C14, f3)), 8, 16, 8, "offset of 1st field after base class with padding");
-    check(Q(offsetof(C14, f4)), 12, 24, 12, "offset of 2nd field after base class with padding");
-
-    check(Q(sizeof(C15)), 16, 16, 12, "base class with double, long");
-    check(Q(sizeof(C16)), 16, 16, 12, "empty derived class with base with double, long");
-    check(Q(sizeof(C17)), 24, 24, 16, "derived class with base with double, long and its own long");
-    check(Q(sizeof(C18)), 20, 24, 16, "derived class based on empty derived class with base with double, long");
-    check(Q(sizeof(C19)), 24, 32, 20, "derived class based on derived class with base with double, long and its own long");
-    check(Q(sizeof(C20)), 12, 16, 12, "class with double and v-table ptr");
-    check(Q(offsetof(C20, f1)), 4, 8, 4, "offset of double 1st field in class with v-table ptr");
+    check(Q(sizeof(C10)), 1, 1, 1, 1, "class based on an empty class, power mode");
+    check(Q(sizeof(C11)), 8, 16, 8, 8, "class with long, char");
+    check(Q(sizeof(C12)), 12, 24, 12, 12, "class with base class with long, char and its own char");
+    check(Q(offsetof(C12, f3)), 8, 16, 8, 8, "offset of 1st field in class with a base class with a long, char");
+    check(Q(sizeof(C13)), 8, 16, 8, 8, "class with long, short");
+    check(Q(sizeof(C14)), 16, 32, 16, 16, "derived class with short, long");
+    check(Q(offsetof(C14, f3)), 8, 16, 8, 8, "offset of 1st field after base class with padding");
+    check(Q(offsetof(C14, f4)), 12, 24, 12, 12, "offset of 2nd field after base class with padding");
+
+    check(Q(sizeof(C15)), 16, 16, 12, 12, "base class with double, long");
+    check(Q(sizeof(C16)), 16, 16, 12, 12, "empty derived class with base with double, long");
+    check(Q(sizeof(C17)), 24, 24, 16, 16, "derived class with base with double, long and its own long");
+    check(Q(sizeof(C18)), 20, 24, 16, 16, "derived class based on empty derived class with base with double, long");
+    check(Q(sizeof(C19)), 24, 32, 20, 20, "derived class based on derived class with base with double, long and its own long");
+    check(Q(sizeof(C20)), 12, 16, 12, 12, "class with double and v-table ptr");
+    check(Q(offsetof(C20, f1)), 4, 8, 4, 4, "offset of double 1st field in class with v-table ptr");
 
     /* Vector tests */
 #ifdef __APPLE_ALTIVEC__
-    check(Q(sizeof(VC1)), 32, 32, 32, "class with vector as 1st field");
-    check(Q(sizeof(VS1)), 48, 48, 48, "struct with a class with a vector as 1st field");
-    check(Q(sizeof(VC2)), 48, 48, 48, "class with base class containing a vector");
-    check(Q(offsetof(VC2, f1)), 32, 32, 32, "offset of 1st field after base class with vector, char, and padding");
-    check(Q(sizeof(VS2)), 80, 80, 80, "struct with a char, class with a vector, char");
-    check(Q(offsetof(VS2, f2)), 16, 16, 16, "offset of class with a vector in a struct with char, class...");
-    check(Q(offsetof(VS2, f3)), 64, 64, 64, "offset of 2nd char in a struct with char, class, char");
-    check(Q(sizeof(VC3)), 32, 32, 32, "class with a vector and v-table ptr");
-    check(Q(offsetof(VC3, f1)), 16, 16, 16, "offset vector in class with a vector and v-table ptr");
+    check(Q(sizeof(VC1)), 32, 32, 32, 32, "class with vector as 1st field");
+    check(Q(sizeof(VS1)), 48, 48, 48, 48, "struct with a class with a vector as 1st field");
+    check(Q(sizeof(VC2)), 48, 48, 48, 48, "class with base class containing a vector");
+    check(Q(offsetof(VC2, f1)), 32, 32, 32, 32, "offset of 1st field after base class with vector, char, and padding");
+    check(Q(sizeof(VS2)), 80, 80, 80, 80, "struct with a char, class with a vector, char");
+    check(Q(offsetof(VS2, f2)), 16, 16, 16, 16, "offset of class with a vector in a struct with char, class...");
+    check(Q(offsetof(VS2, f3)), 64, 64, 64, 64, "offset of 2nd char in a struct with char, class, char");
+    check(Q(sizeof(VC3)), 32, 32, 32, 32, "class with a vector and v-table ptr");
+    check(Q(offsetof(VC3, f1)), 16, 16, 16, 16, "offset vector in class with a vector and v-table ptr");
 #endif
 
     /* bool tests */
-    check(Q(sizeof(bool)), 4, 1, 1, "bool data type");
-    check(Q(sizeof(B1)), 8, 2, 2, "struct with bool, char");
-    check(Q(sizeof(B2)), 8, 2, 2, "struct with char, bool");
+    check(Q(sizeof(bool)), 4, 1, 1, 1, "bool data type");
+    check(Q(sizeof(B1)), 8, 2, 2, 2, "struct with bool, char");
+    check(Q(sizeof(B2)), 8, 2, 2, 2, "struct with char, bool");
 
     if (nbr_failures > 0)
     	return 1;
     else
     	return 0;
 }
+/* APPLE LOCAL end ARM alignments */





More information about the llvm-commits mailing list