bart | 3d4c332 | 2008-05-10 08:48:14 +0000 | [diff] [blame] | 1 | /** Simple regression test triggering the C++ operators new and delete. */ |
| 2 | |
| 3 | #include <stdio.h> |
| 4 | |
| 5 | int main(int argc, char** argv) |
| 6 | { |
bart | fd68049 | 2008-05-13 16:16:14 +0000 | [diff] [blame] | 7 | int zero = 0; |
bart | 3d4c332 | 2008-05-10 08:48:14 +0000 | [diff] [blame] | 8 | int* p = new int; |
| 9 | int* q = new int[733]; |
| 10 | delete[] q; |
| 11 | delete p; |
| 12 | |
bart | fd68049 | 2008-05-13 16:16:14 +0000 | [diff] [blame] | 13 | q = new int[zero]; |
| 14 | delete q; |
| 15 | |
bart | 3d4c332 | 2008-05-10 08:48:14 +0000 | [diff] [blame] | 16 | fprintf(stderr, "Success.\n"); |
| 17 | |
| 18 | return 0; |
| 19 | } |