-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// This is a small test program to test Issue #177. | ||
// When compiled without optimization, it generates incorrect assembly. | ||
// When compiled with optimization, it generates correct assembly. | ||
|
||
#include <sysdef.h> | ||
|
||
long a = 0; | ||
long b = 0; | ||
|
||
// convenient mechanism to access QNICE's Memory Mapped IO registers | ||
#define MMIO( __x ) *((unsigned int volatile *) __x ) | ||
|
||
static __interrupt void isr(void) | ||
{ | ||
if (!a) | ||
return; | ||
b += 1; | ||
} | ||
|
||
int main() | ||
{ | ||
// Enable timer interrupt @ 10000 Hz | ||
MMIO(IO_TIMER_0_INT) = (unsigned int) isr; | ||
|
||
return 0; | ||
} | ||
|