aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr24930.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr24930.c')
-rw-r--r--gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr24930.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr24930.c b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr24930.c
new file mode 100644
index 000000000..d52bb5c50
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/gcc.c-torture/compile/pr24930.c
@@ -0,0 +1,17 @@
+/* PR 24930 */
+extern int foo(int u) __attribute__((noinline));
+int foo(int u) {return 0;}
+int
+main(int argc, char** argv)
+{
+ const char *buf = argv[1];
+
+ unsigned int data = (((unsigned int) buf[0]) << 8) + (unsigned int) buf[1];
+ if (data & 0x8000) {
+ data &= 0x7fff ;
+ data ^= 0x7fff ;
+ data += 1 ;
+ data *= -1 ;
+ }
+ return foo((int)data);
+}