Imported Upstream version 2.9.0
[debian/cc1111] / src / regression / gpsim_assert.h
1 /*------------------------------------------------------------------------------
2
3   gpsim_assert.h - assertion macros generating gpsim breakpoints
4
5   Copyright (c) 2006 Borut Razem
6
7   This program is free software; you can redistribute it and/or modify it
8   under the terms of the GNU General Public License as published by the
9   Free Software Foundation; either version 2, or (at your option) any
10   later version.
11
12   This program is distributed in the hope that it will be useful,
13   but WITHOUT ANY WARRANTY; without even the implied warranty of
14   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15   GNU General Public License for more details.
16
17   You should have received a copy of the GNU General Public License
18   along with this program; if not, write to the Free Software
19   Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
20   USA.
21
22 ------------------------------------------------------------------------------*/
23
24
25 #ifndef __PIC_ASSERT_H
26 #define __PIC_ASSERT_H
27
28 #define MANGLE(e) _##e
29 #define STRINGIFY(e) #e
30
31 #define ASSERT(e) \
32   __asm \
33   nop \
34   __endasm; \
35   __asm \
36   .direct "a", STRINGIFY(e) \
37   __endasm; \
38   __asm \
39   nop \
40   __endasm;
41
42 #define PASSED() \
43   __asm \
44   nop \
45   __endasm; \
46   __asm \
47   .direct "a", "\"PASSED\"" \
48   __endasm; \
49   __asm \
50   nop \
51   __endasm;
52
53 #define FAILED() \
54   __asm \
55   nop \
56   __endasm; \
57   __asm \
58   .direct "a", "\"===> FAILED\"" \
59   __endasm; \
60   __asm \
61   nop \
62   __endasm;
63
64 #endif