OSDN Git Service

Fix lowering ARM shift by zero as a move.
[android-x86/external-swiftshader.git] / crosstest / test_global.cpp
index 08a213e..b5519a0 100644 (file)
@@ -29,14 +29,8 @@ extern uint8_t *ExternName5;
 int ArrayInitPartial[10] = {60, 70, 80, 90, 100};
 int ArrayInitFull[] = {10, 20, 30, 40, 50};
 const int ArrayConst[] = {-10, -20, -30};
-static double ArrayDouble[10] = { 0.5, 1.5, 2.5, 3.5 };
+static double ArrayDouble[10] = {0.5, 1.5, 2.5, 3.5};
 
-#if 0
-// TODO(kschimpf) Add this example once we know how to not mangle
-// uninitialized, external globals (so that we can compare that
-// the same, unmangled relocations are used). See comment in
-// TargetGlobalInitX8632::lower in IceTargetLoweringX8632.cpp for
-// details.
 static struct {
   int Array1[5];
   uint8_t *Pointer1;
@@ -49,14 +43,13 @@ static struct {
   } NestedStuff;
   uint8_t *Pointer5;
 } StructEx = {
-  { 10, 20, 30, 40, 50 },
-  ExternName1,
-  { 0.5, 1.5, 2.5 },
-  ExternName4,
-  { ExternName3, {1000, 1010, 1020}, ExternName2 },
-  ExternName5,
+    {10, 20, 30, 40, 50},
+    ExternName1,
+    {0.5, 1.5, 2.5},
+    ExternName4,
+    {ExternName3, {1000, 1010, 1020}, ExternName2},
+    ExternName5,
 };
-#endif
 
 #define ARRAY(a)                                                               \
   { (uint8_t *)(a), sizeof(a) }
@@ -68,13 +61,13 @@ struct {
   uint8_t *ArrayAddress;
   size_t ArraySizeInBytes;
 } Arrays[] = {
-      ARRAY(ArrayInitPartial),
-      ARRAY(ArrayInitFull),
-      ARRAY(ArrayConst),
-      ARRAY(ArrayDouble),
-      {(uint8_t *)(ArrayInitPartial + 2),
-       sizeof(ArrayInitPartial) - 2 * sizeof(int)},
-      // { (uint8_t*)(&StructEx), sizeof(StructEx) },
+    ARRAY(ArrayInitPartial),
+    ARRAY(ArrayInitFull),
+    ARRAY(ArrayConst),
+    ARRAY(ArrayDouble),
+    {(uint8_t *)(ArrayInitPartial + 2),
+     sizeof(ArrayInitPartial) - 2 * sizeof(int)},
+    {(uint8_t *)(&StructEx), sizeof(StructEx)},
 };
 size_t NumArraysElements = sizeof(Arrays) / sizeof(*Arrays);