diff options
| author | Michael Matz <matz@suse.de> | 2016-03-26 17:57:22 +0100 |
|---|---|---|
| committer | Michael Matz <matz@suse.de> | 2016-03-26 17:57:22 +0100 |
| commit | 80343ab7d829c21c65f8f9a14dd20158d028549f (patch) | |
| tree | 0d5cf87dfcc350eaeeb71c6f5255d494f5e8879e /tests/tcctest.c | |
| parent | 8fc5a6a2a49f05c358e293c79c0bf18e8eb4830e (diff) | |
| download | tinycc-80343ab7d829c21c65f8f9a14dd20158d028549f.tar.gz tinycc-80343ab7d829c21c65f8f9a14dd20158d028549f.tar.bz2 | |
Fix assignment to/from volatile types
Code like this was broken:
char volatile vi = i;
See testcase, happens in ideosyncratic legacy code sprinkling
volatile all over.
Diffstat (limited to 'tests/tcctest.c')
| -rw-r--r-- | tests/tcctest.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/tcctest.c b/tests/tcctest.c index 381a992..823a657 100644 --- a/tests/tcctest.c +++ b/tests/tcctest.c @@ -119,6 +119,8 @@ int isid(int c); void funny_line_continuation (int, ..\ . ); +char via_volatile (char); + #define A 2 #define N 1234 + A #define pf printf @@ -693,6 +695,8 @@ int main(int argc, char **argv) callsave_test(); builtin_frame_address_test(); intdiv_test(); + if (via_volatile (42) != 42) + printf ("via_volatile broken\n"); return 0; } @@ -2848,3 +2852,10 @@ void builtin_frame_address_test(void) bfa1(str-fp0); #endif } + +char via_volatile (char i) +{ + char volatile vi; + vi = i; + return vi; +} |
