diff options
author | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-23 12:53:36 +0000 |
---|---|---|
committer | bstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4> | 2012-04-23 12:53:36 +0000 |
commit | 65cbf05437b8a57ff08846beb19407c9e0dd2553 (patch) | |
tree | 0b0bd391a56275bab5bf67e4094d9b7a24ade79c /gcc/testsuite/gcc.target/powerpc | |
parent | 381399a9fee786a047529a0f7de787de475ab97c (diff) | |
download | gcc-65cbf05437b8a57ff08846beb19407c9e0dd2553.tar.gz |
2012-04-23 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 186692 using svnmerge
[gcc/]
2012-04-23 Basile Starynkevitch <basile@starynkevitch.net>
{{improvements for merging with GCC 4.8 trunk svn rev 186692}}
* melt-run.proto.h (MELT_GCC_VERSION): Define, if unknown, in the
generated melt-run.h
* melt-runtime.c (melt_val2passflag): TODO_dump_func &
TODO_dump_cgraph don't exist in GCC 4.8.
* melt-build.tpl: Say flavor, not variant! Build first the
quicklybuilt application modules, to catch error in macro C
strings...
* melt-build.mk: Regenerate.
* melt/warmelt-base.melt (valdesc_strbuf): Check for MELT_GCC_VERSION also.
* melt/warmelt-genobj.melt (compilobj_nrep_citeration): Use
meltcit prefix in generated citerator names..
* melt/warmelt-outobj.melt (syntestgen_citerator): Use
meltcitstate prefix.
* melt/xtramelt-ana-base.melt (each_cgraph_fun_body)
(each_cgraph_fun_entryblock, each_cgraph_fun_call_flow_graph)
(each_bb_cfun, with_cfun_decl): Adapt to GCC 4.8, add
documentation.
(each_cgraph_decl): Only for GCC 4.6 & 4.7
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@186705 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/testsuite/gcc.target/powerpc')
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr16458-1.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr16458-2.c | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr16458-3.c | 41 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr16458-4.c | 44 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/powerpc/pr52775.c | 16 |
5 files changed, 137 insertions, 0 deletions
diff --git a/gcc/testsuite/gcc.target/powerpc/pr16458-1.c b/gcc/testsuite/gcc.target/powerpc/pr16458-1.c new file mode 100644 index 00000000000..45b8c75c069 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr16458-1.c @@ -0,0 +1,18 @@ +/* Test cse'ing of unsigned compares. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* { dg-final { scan-assembler-not "cmpw" } } */ +/* { dg-final { scan-assembler-times "cmplw" 1 } } */ + +unsigned int a, b; + +int +foo (void) +{ + if (a == b) return 1; + if (a > b) return 2; + if (a < b) return 3; + if (a != b) return 4; + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr16458-2.c b/gcc/testsuite/gcc.target/powerpc/pr16458-2.c new file mode 100644 index 00000000000..95e97de5560 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr16458-2.c @@ -0,0 +1,18 @@ +/* Test cse'ing of unsigned compares. */ +/* { dg-do compile } */ +/* { dg-options "-O2" } */ + +/* { dg-final { scan-assembler-not "cmpw" } } */ +/* { dg-final { scan-assembler-times "cmplw" 1 } } */ + +unsigned int *a, *b; + +int +foo (void) +{ + if (*a == *b) return 1; + if (*a > *b) return 2; + if (*a < *b) return 3; + if (*a != *b) return 4; + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr16458-3.c b/gcc/testsuite/gcc.target/powerpc/pr16458-3.c new file mode 100644 index 00000000000..740d61dcc74 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr16458-3.c @@ -0,0 +1,41 @@ +/* Test cse'ing of unsigned compares. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-jump-tables" } */ + +/* { dg-final { scan-assembler-not "cmpwi" } } */ +/* { dg-final { scan-assembler-times "cmplwi" 5 } } */ + +extern int case0 (void); +extern int case1 (void); +extern int case2 (void); +extern int case3 (void); +extern int case4 (void); + +enum CASE_VALUES +{ + CASE0 = 1, + CASE1, + CASE2, + CASE3, + CASE4 +}; + +int +foo (enum CASE_VALUES index) +{ + switch (index) + { + case CASE0: + return case0 (); + case CASE1: + return case1 (); + case CASE2: + return case2 (); + case CASE3: + return case3 (); + case CASE4: + return case4 (); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr16458-4.c b/gcc/testsuite/gcc.target/powerpc/pr16458-4.c new file mode 100644 index 00000000000..8db43e82384 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr16458-4.c @@ -0,0 +1,44 @@ +/* Test cse'ing of unsigned compares. */ +/* { dg-do compile } */ +/* { dg-options "-O2 -fno-jump-tables" } */ + +/* The following tests fail due to an issue in expand not + attaching an type expression information on *index's reg rtx. */ + +/* { dg-final { scan-assembler-not "cmpwi" } } */ +/* { dg-final { scan-assembler-times "cmplwi" 5 } } */ + +extern int case0 (void); +extern int case1 (void); +extern int case2 (void); +extern int case3 (void); +extern int case4 (void); + +enum CASE_VALUES +{ + CASE0 = 1, + CASE1, + CASE2, + CASE3, + CASE4 +}; + +int +foo (enum CASE_VALUES *index) +{ + switch (*index) + { + case CASE0: + return case0 (); + case CASE1: + return case1 (); + case CASE2: + return case2 (); + case CASE3: + return case3 (); + case CASE4: + return case4 (); + } + + return 0; +} diff --git a/gcc/testsuite/gcc.target/powerpc/pr52775.c b/gcc/testsuite/gcc.target/powerpc/pr52775.c new file mode 100644 index 00000000000..4027819ee63 --- /dev/null +++ b/gcc/testsuite/gcc.target/powerpc/pr52775.c @@ -0,0 +1,16 @@ +/* { dg-do compile { target { powerpc*-*-* && ilp32 } } } */ +/* { dg-skip-if "" { powerpc*-*-darwin* } { "*" } { "" } } */ +/* { dg-options "-O1 -mcpu=power4" } */ +/* { dg-final { scan-assembler-times "fcfid" 2 } } */ + +double +int_to_double (int *p) +{ + return (double)*p; +} + +double +long_long_to_double (long long *p) +{ + return (double)*p; +} |