gcc/testsuite/g++.old-deja/g++.other/string1.C
raw| 1 | // { dg-do assemble } |
| 2 | // Origin: [email protected] (Mike Stump) |
| 3 | |
| 4 | class Wrapper { |
| 5 | public: |
| 6 | static const char msgPtr[]; |
| 7 | static const char *JunkFunc() { |
| 8 | return &msgPtr[0]; |
| 9 | } |
| 10 | }; |
| 11 | |
| 12 | const char Wrapper::msgPtr[] = "Hello world."; |
| 13 | |
| 14 | int main() { |
| 15 | const char *p1 = &Wrapper::msgPtr[0]; |
| 16 | const char *p2 = Wrapper::JunkFunc(); |
| 17 | |
| 18 | if (p1 != p2) |
| 19 | return 1; |
| 20 | } |