diff options
Diffstat (limited to 'gcc/testsuite/g++.old-deja/g++.other/null2.C')
-rw-r--r-- | gcc/testsuite/g++.old-deja/g++.other/null2.C | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.old-deja/g++.other/null2.C b/gcc/testsuite/g++.old-deja/g++.other/null2.C new file mode 100644 index 000000000..3c8c50a20 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/null2.C @@ -0,0 +1,13 @@ +// { dg-do run } +// Based on a testcase by Eric Dumazet <Eric.Dumazet@COSMOSBAY.COM> + +extern "C" void abort (); + +const char * const foo = ""; // foo is not NULL + +int main() { + if ((foo == 0) ? 0 : foo) // so this should evaluate to `foo' + return 0; + else + abort(); +} |