Enable test for exceptions

This commit is contained in:
Jonas Hahnfeld 2021-01-27 10:35:53 +01:00 committed by jenkins
parent f66a1970b9
commit 173de1db30
2 changed files with 20 additions and 6 deletions

20
test/Prompt/Exceptions.C Normal file
View File

@ -0,0 +1,20 @@
//------------------------------------------------------------------------------
// CLING - the C++ LLVM-based InterpreterG :)
//
// This file is dual-licensed: you can choose to license it under the University
// of Illinois Open Source License or the GNU Lesser General Public License. See
// LICENSE.TXT for details.
//------------------------------------------------------------------------------
// RUN: cat %s | %cling 2>&1 | FileCheck %s
extern "C" int printf(const char*,...);
struct TheStruct {
char m_Storage[100];
};
// CHECK: About to throw "ABC"
printf("About to throw \"ABC\"\n");
TheStruct getStructButThrows() { throw "ABC!"; }
// CHECK: Exception occurred. Recovering...
getStructButThrows()

View File

@ -1,6 +0,0 @@
struct TheStruct {
char m_Storage[100];
};
TheStruct getStructButThrows() { throw "ABC!"; }
getStructButThrows()