From fc2ddcf91e7d14df94fc6fde8b880dd68e7b18b7 Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Wed, 3 Sep 2008 12:42:46 +0000 Subject: [PATCH] fehler147 (produces invisible lightning gun in quake3) [r21664] --- ir/be/test/fehler147.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 ir/be/test/fehler147.c diff --git a/ir/be/test/fehler147.c b/ir/be/test/fehler147.c new file mode 100644 index 000000000..0ab53fd93 --- /dev/null +++ b/ir/be/test/fehler147.c @@ -0,0 +1,24 @@ +float g = 0.098; + +#define myftol(x) ((int)(x)) + +void foo(unsigned char *colors) { + int v; + float glow = g; + + if (glow < 0) { + glow = 0; + } else if(glow > 1) { + glow = 1; + } + + v = myftol(255*glow); + colors[0] = colors[1] = colors[2] = v; +} + +int main(void) { + unsigned char colors[3]; + foo(colors); + printf("%d %d %d\n", colors[0], colors[1], colors[2]); + return 0; +} -- 2.20.1