浏览代码

gcc: Fix `register' test on 32-bit platforms.

* gcc-plugin/tests/register.c (foo): Change type of `x' to `int' to make
  sure it has an alignment > 1 byte, even on i686, since <mocks.h>
  relies on this.
Ludovic Courtès 13 年之前
父节点
当前提交
5e2e59f3b5
共有 1 个文件被更改,包括 4 次插入4 次删除
  1. 4 4
      gcc-plugin/tests/register.c

+ 4 - 4
gcc-plugin/tests/register.c

@@ -1,5 +1,5 @@
 /* GCC-StarPU
-   Copyright (C) 2011 Institut National de Recherche en Informatique et Automatique
+   Copyright (C) 2011, 2012 Institut National de Recherche en Informatique et Automatique
 
    GCC-StarPU is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -23,11 +23,11 @@
 static void
 foo (void)
 {
-  char x[] = { 1, 2, 3 };
+  int x[] = { 1, 2, 3 };
 
   expected_register_arguments.pointer = x;
-  expected_register_arguments.elements = sizeof x;
-  expected_register_arguments.element_size = 1;
+  expected_register_arguments.elements = sizeof x / sizeof x[0];
+  expected_register_arguments.element_size = sizeof x[0];
 #pragma starpu register x /* (warning "considered unsafe") */
 }