struct / union in initializer, RFE #901.
[sdcc.git] / sdcc / support / regression / tests / bug-3481.c
blobc3cf55fca4b139fe89129f0be5596dc020f152c9
1 /* bug-3481.c
2 A crash in iCode generation for parameters to calls to functions without prototypes.
3 */
5 #include <testfwk.h>
7 // Function declarations without prototypes no longer exist in C2X.
8 #pragma std_c99
9 #pragma disable_warning 283
11 // Test derived from code by SF user "Under4Mhz" in 2022.
13 #include <stdint.h>
15 #if 0 // Bug not yet fixed
16 uint16_t fast_rand();
18 void ImageStatusImage( uint8_t health ) {
19 uint8_t frame = fast_rand( health ) % 4;
22 void g( void )
24 ASSERT ( fast_rand ( 1 ) == 2 );
27 uint16_t fast_rand( int x ) {
28 return( x + 1 );
30 #endif
32 void
33 testBug( void ) {
34 #if 0 // Bug not yet fixed
35 ASSERT ( fast_rand ( 1 ) == 2 );
36 g ();
37 #endif