1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
8 #include "native_client/src/include/nacl/nacl_exception.h"
9 #include "ppapi/native_client/tests/ppapi_test_lib/test_interface.h"
15 void MyNaClExceptionHandler(struct NaClExceptionContext
* context
) {
16 printf("--- MyNaClExceptionHandler\n");
17 longjmp(g_jmp_buf
, 1);
20 void CrashViaSignalHandler() {
21 printf("--- CrashViaSignalHandler\n");
23 int retval
= nacl_exception_set_handler(MyNaClExceptionHandler
);
25 printf("Unexpected return value from nacl_exception_set_handler: %d\n",
31 if (setjmp(g_jmp_buf
)) {
32 printf("Returned via longjmp\n");
36 printf("Going to crash\n");
43 RegisterTest("CrashViaSignalHandler", CrashViaSignalHandler
);
46 void SetupPluginInterfaces() {}