diff options
Diffstat (limited to 'util/romcc')
-rw-r--r-- | util/romcc/tests/simple_test16.c | 18 | ||||
-rw-r--r-- | util/romcc/tests/simple_test17.c | 39 | ||||
-rw-r--r-- | util/romcc/tests/simple_test18.c | 3 | ||||
-rw-r--r-- | util/romcc/tests/simple_test4.c | 2 |
4 files changed, 61 insertions, 1 deletions
diff --git a/util/romcc/tests/simple_test16.c b/util/romcc/tests/simple_test16.c new file mode 100644 index 0000000000..0620f1a1d4 --- /dev/null +++ b/util/romcc/tests/simple_test16.c @@ -0,0 +1,18 @@ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; + + +static void outb(uint8_t value, uint16_t port) +{ + __builtin_outb(value, port); +} + + +static void main(void) +{ + uint32_t i; + for(i = 0; i < 32; i++) { + outb(i, 0x80); + } +} diff --git a/util/romcc/tests/simple_test17.c b/util/romcc/tests/simple_test17.c new file mode 100644 index 0000000000..27586141d4 --- /dev/null +++ b/util/romcc/tests/simple_test17.c @@ -0,0 +1,39 @@ +typedef unsigned char uint8_t; +typedef unsigned short uint16_t; +typedef unsigned int uint32_t; + + +struct iter { + uint32_t i; +}; + +struct point { + uint32_t i, j; +}; + +static void outb(uint8_t value, uint16_t port) +{ + __builtin_outb(value, port); +} + + +static struct point mkpoint(void) +{ + struct point p; + p.i = 1000; + p.j = 2000; + return p; +} + +static void main(void) +{ + struct iter iter; + for(iter.i = 0; iter.i < 32; iter.i++) { + outb(iter.i, 0x80); + } + struct point p; + p = mkpoint(); + outb(p.i, 0x80); + outb(p.j, 0x80); +} + diff --git a/util/romcc/tests/simple_test18.c b/util/romcc/tests/simple_test18.c new file mode 100644 index 0000000000..bd4a3550af --- /dev/null +++ b/util/romcc/tests/simple_test18.c @@ -0,0 +1,3 @@ +static void main(void) +{ +} diff --git a/util/romcc/tests/simple_test4.c b/util/romcc/tests/simple_test4.c index bfc05d9e0d..57af2af390 100644 --- a/util/romcc/tests/simple_test4.c +++ b/util/romcc/tests/simple_test4.c @@ -2,7 +2,7 @@ #define HAVE_CAST_SUPPORT 1 #define HAVE_STATIC_ARRAY_SUPPORT 1 #define HAVE_POINTER_SUPPORT 1 -#define HAVE_CONSTANT_PROPOGATION 1 +#define HAVE_CONSTANT_PROPOGATION 0 #define CALCULATE_DRB_REG 1 void outb(unsigned char value, unsigned short port) |