OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [gcc.dg/] [simulate-thread/] [strict-align-global.c] - Blame information for rev 749

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 689 jeremybenn
/* { dg-do link } */
2
/* { dg-options "--param allow-packed-store-data-races=0" } */
3
/* { dg-final { simulate-thread } } */
4
 
5
#include <stdio.h>
6
#include "simulate-thread.h"
7
 
8
/* This test verifies writes to globals do not write to adjacent
9
   globals.  This mostly happens on strict-align targets that are not
10
   byte addressable (old Alphas, etc).  */
11
 
12
char a = 0;
13
char b = 77;
14
 
15
void simulate_thread_other_threads()
16
{
17
}
18
 
19
int simulate_thread_step_verify()
20
{
21
  if (b != 77)
22
    {
23
      printf("FAIL: Unexpected value.  <b> is %d, should be 77\n", b);
24
      return 1;
25
    }
26
  return 0;
27
}
28
 
29
/* Verify that every variable has the correct value.  */
30
int simulate_thread_final_verify()
31
{
32
  int ret = simulate_thread_step_verify ();
33
  if (a != 66)
34
    {
35
      printf("FAIL: Unexpected value.  <a> is %d, should be 66\n", a);
36
      return 1;
37
    }
38
  return ret;
39
}
40
 
41
__attribute__((noinline))
42
void simulate_thread_main()
43
{
44
  a = 66;
45
}
46
 
47
int main ()
48
{
49
  simulate_thread_main();
50
  simulate_thread_done();
51
  return 0;
52
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.