X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=gcc%2Ftestsuite%2Fg%2B%2B.dg%2Finit%2Finit-ref2.C;fp=gcc%2Ftestsuite%2Fg%2B%2B.dg%2Finit%2Finit-ref2.C;h=0000000000000000000000000000000000000000;hb=6fed43773c9b0ce596dca5686f37ac3fc0fa11c0;hp=6d9448a8e9c8628aa5d26526688b7474f7d31abc;hpb=27b11d56b743098deb193d510b337ba22dc52e5c;p=msp430-gcc.git diff --git a/gcc/testsuite/g++.dg/init/init-ref2.C b/gcc/testsuite/g++.dg/init/init-ref2.C deleted file mode 100644 index 6d9448a8..00000000 --- a/gcc/testsuite/g++.dg/init/init-ref2.C +++ /dev/null @@ -1,42 +0,0 @@ -// Submitted by Jason Merrill -// Test for proper handling of local static references. -// { dg-do run } - -int r; - -int c; -int f () -{ - // Test that we only initialize i once. - if (++c > 1) - ++r; - return 42; -} - -const int *p; -void g () -{ - static const int &i = f(); - - // Test that i points to the same place in both calls. - if (p && p != &i) - ++r; - // Test that if so, it points to static data. - if (i != 42) - ++r; - - p = &i; -} - -void h () -{ - int arr[] = { 1, 1, 1, 1, 1, 1, 1 }; - g (); -} - -int main () -{ - g (); - h (); - return r; -}