First public contribution.
1 // Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of the License "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
14 // e32test\misc\exc.cpp
15 // Utility generating various kinds of exceptions. Useful to test
21 #include <e32std_private.h>
23 void InfiniteRecursion()
29 #pragma Ono_inline // prevent compile time errors
31 void Store42(TInt*& p)
38 // uninitialised pointer on stack - may not crash
44 TInt32* p = (TInt32*)ps;
49 TInt16* p = (TInt16*)ps;
56 User::CommandLine(cmd);
61 typedef void (*TPfn)();
68 // data abort - accessing non-existent memory
69 TInt* p = (TInt*) 0x1000;
74 // data abort - stack overflow
79 // data abort - pointer in deleted heap cell
80 // May not crash on UREL builds
81 struct S { TInt* iPtr; };
90 // data abort - uninitialised pointer on stack
95 // data abort - misaligned access to 32 bit word
102 // data abort - misaligned access to 16 bit word
116 // undefined instruction
117 TUint32 undef = 0xE6000010;
118 TPfn f = (TPfn) &undef;