-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
31 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! winxed | ||
|
||
// int operators | ||
|
||
using extern Test.More plan, throws_type, diag; | ||
|
||
$include_const 'except_types.pasm'; | ||
|
||
function main() | ||
{ | ||
plan (1); | ||
|
||
diag("Exceptions:"); | ||
|
||
throws_type(divzero, EXCEPTION_DIV_BY_ZERO, "division by zero"); | ||
} | ||
|
||
function divzero() | ||
{ | ||
// Use a function to make sure is not evaluated at compile time. | ||
int i = divide(1, 0); | ||
} | ||
|
||
function divide(int a, int b) | ||
{ | ||
return a / b; | ||
} | ||
|
||
// End |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters