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

Subversion Repositories or1k

[/] [or1k/] [branches/] [stable_0_2_x/] [or1ksim/] [testbench/] [local_global.c] - Rev 1765

Compare with Previous | Blame | View Log

/* Test local and global variables */
#include "support.h"
 
int global = 5;
 
int func (unsigned long a, char b) {
  global = 2;
  a = 3 + a;
  b = 4 + b;
  return a + b;
}
 
int main () {
  int local = 7;
  global += func (local, 14);
  report (global ^ 0xdeaddead ^ 30);
  return 0;
}
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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