From: jconner Date: Wed, 14 Sep 2005 21:34:37 +0000 (+0000) Subject: PR middle-end/23584 X-Git-Tag: upstream/4.9.2~58637 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=454ca2054a3d2e71c84c3999f9d73f516eedd1b8;p=platform%2Fupstream%2Flinaro-gcc.git PR middle-end/23584 * gcc.dg/pr23584.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@104284 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 94ae3be..c74bd24 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-09-14 Josh Conner + + PR middle-end/23584 + * gcc.dg/pr23584.c: New test. + 2005-09-14 Jerry DeLisle PR fortran/21875 Internal Unit Array I/O, NIST diff --git a/gcc/testsuite/gcc.dg/pr23584.c b/gcc/testsuite/gcc.dg/pr23584.c new file mode 100644 index 0000000..691a119 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr23584.c @@ -0,0 +1,21 @@ +/* Regression test for PR middle-end/23584 */ +/* Verify that dereferencing an absolute address inside of a function + makes that function impure. */ + +/* { dg-do compile } */ +/* { dg-options "-O1 -fdump-ipa-pure-const" } */ + +int test1 (void) +{ + return * (volatile int *) 0x1234; +} + +int test2 (void) +{ + int local = * (volatile int *) 0x1234; + return local; +} + +/* { dg-final { scan-ipa-dump-not "found to be pure: test1" "pure-const" } } */ +/* { dg-final { scan-ipa-dump-not "found to be pure: test2" "pure-const" } } */ +/* { dg-final { cleanup-ipa-dump "pure-const" } } */