1/****************************************************************************
2**
3** Copyright (C) 2016 The Qt Company Ltd.
4** Copyright (C) 2020 Intel Corporation.
5** Contact: https://www.qt.io/licensing/
6**
7** This file is part of the test suite of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:GPL-EXCEPT$
10** Commercial License Usage
11** Licensees holding valid commercial Qt licenses may use this file in
12** accordance with the commercial license agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and The Qt Company. For licensing terms
15** and conditions see https://www.qt.io/terms-conditions. For further
16** information use the contact form at https://www.qt.io/contact-us.
17**
18** GNU General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU
20** General Public License version 3 as published by the Free Software
21** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
22** included in the packaging of this file. Please review the following
23** information to ensure the GNU General Public License requirements will
24** be met: https://www.gnu.org/licenses/gpl-3.0.html.
25**
26** $QT_END_LICENSE$
27**
28****************************************************************************/
29
30void crashFallback(volatile int *ptr = nullptr)
31{
32 *ptr = 0;
33}
34
35#if defined(_MSC_VER)
36# include <intrin.h>
37
38int main()
39{
40# if defined(_M_IX86) || defined(_M_X64)
41 __ud2();
42# endif
43
44 crashFallback();
45}
46#elif defined(__MINGW32__)
47int main()
48{
49 asm("ud2");
50 crashFallback();
51}
52#else
53# include <stdlib.h>
54
55int main()
56{
57 abort();
58}
59#endif
60

source code of qtbase/tests/auto/corelib/io/qprocess/testProcessCrash/main.cpp