diff options
author | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-12-14 10:32:56 +0000 |
---|---|---|
committer | rguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-12-14 10:32:56 +0000 |
commit | c3105742c021355f96d5b05dd2be8b375122e31d (patch) | |
tree | a26bd4d8afaefeb0ed6f69af8aeb56adc3c57358 | |
parent | eee9f9a5679d74c9be5106b51eab30ea24716e1a (diff) | |
download | gcc-c3105742c021355f96d5b05dd2be8b375122e31d.tar.gz |
2016-12-14 Richard Biener <rguenther@suse.de>
PR tree-optimization/78731
* gcc.dg/torture/pr78731.c: New testcase.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/gcc-6-branch@243642 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/torture/pr78731.c | 41 |
2 files changed, 46 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index aa87408711d..4dd657ae9e6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-12-14 Richard Biener <rguenther@suse.de> + + PR tree-optimization/78731 + * gcc.dg/torture/pr78731.c: New testcase. + 2016-12-14 Thomas Preud'homme <thomas.preudhomme@arm.com> Backport from mainline diff --git a/gcc/testsuite/gcc.dg/torture/pr78731.c b/gcc/testsuite/gcc.dg/torture/pr78731.c new file mode 100644 index 00000000000..5a4d43be1f9 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr78731.c @@ -0,0 +1,41 @@ +/* { dg-do run } */ + +#include <stdio.h> +#include <stdlib.h> + +#define GENERAL 1 +#define BRACKETS 2 +#define QUOTES 3 + +void __attribute__((noinline,noclone)) +foo(char *qb, char* into) +{ + int state = QUOTES; + int save_state = BRACKETS; + + while (qb) + { + switch (state) + { + case BRACKETS: + exit(0); + case GENERAL: + abort (); + case QUOTES: + state = save_state; + save_state = GENERAL; + break; + default: ; + } + printf("State %d btw GENERAL %d\n", state, GENERAL); + } + abort (); +} + +int main() +{ + char *b = "123"; + char out[4]; + foo(b, out); + return 0; +} |