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
(include "~~lib/_gambit#.scm") | |
(define-syntax primitive | |
(lambda (src) | |
(define (err) | |
(##raise-expression-parsing-exception | |
'ill-formed-special-form | |
src | |
(##source-strip (##car (##source-strip src))))) |
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
/* | |
* This program has similar behavior to switch-bug1.c but | |
* the JS code generated by emscripten is a bit more complex. | |
* The sequence of ifs contains some large conditional expressions | |
* to take into account the code common to several branches of | |
* the switch. | |
*/ | |
#include <stdio.h> |
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
/* | |
* Normal behavior, the program runs in less than a second. And | |
* when START is 50, there is roughly half as much work to do: | |
* | |
* % clang -O2 -g -DSTART=0 switch-bug1.c -o switch-bug1 | |
* % /usr/bin/time ./switch-bug1 | |
* start = 0 | |
* end (sum=200000000) | |
* 0.93 real 0.92 user 0.00 sys | |
* % clang -O2 -g -DSTART=50 switch-bug1.c -o switch-bug1 |