1 // Copyright 2019 The Chromium Authors 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #include "base/immediate_crash.h" // nogncheck 6 7 #if defined(WIN32) 8 #define IMMEDIATE_CRASH_TEST_HELPER_EXPORT __declspec(dllexport) 9 #else // defined(WIN32) 10 #define IMMEDIATE_CRASH_TEST_HELPER_EXPORT \ 11 __attribute__((visibility("default"))) 12 #endif // defined(WIN32) 13 14 extern "C" { 15 TestFunction1(int x,int y)16IMMEDIATE_CRASH_TEST_HELPER_EXPORT int TestFunction1(int x, int y) { 17 if (x < 1) 18 base::ImmediateCrash(); 19 if (y < 1) 20 base::ImmediateCrash(); 21 return x + y; 22 } 23 TestFunction2(int x,int y)24IMMEDIATE_CRASH_TEST_HELPER_EXPORT int TestFunction2(int x, int y) { 25 if (x < 2) 26 base::ImmediateCrash(); 27 if (y < 2) 28 base::ImmediateCrash(); 29 return x * y; 30 } 31 32 } // extern "C" 33