PR tree-optimization/81303
[official-gcc.git] / gcc / testsuite / gcc.dg / pr23584.c
blob0ac388997aa2f225a47d7c2c2ca5599d2b4c223a
1 /* Regression test for PR middle-end/23584 */
2 /* Verify that dereferencing an absolute address inside of a function
3 makes that function impure. */
5 /* { dg-do compile } */
6 /* { dg-options "-O1 -fdump-ipa-pure-const" } */
8 int test1 (void)
10 return * (volatile int *) 0x1234;
13 int test2 (void)
15 int local = * (volatile int *) 0x1234;
16 return local;
19 /* { dg-final { scan-ipa-dump-not "found to be pure: test1" "pure-const" } } */
20 /* { dg-final { scan-ipa-dump-not "found to be pure: test2" "pure-const" } } */