Changeset 54651005 for doc/theses/andrew_beach_MMath/code/cross-finally.cfa
- Timestamp:
- Jul 20, 2021, 3:31:20 PM (3 years ago)
- Branches:
- ADT, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, master, new-ast-unique-expr, pthread-emulation, qualifiedEnum
- Children:
- 86fc350
- Parents:
- 815c6ae
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
doc/theses/andrew_beach_MMath/code/cross-finally.cfa
r815c6ae r54651005 5 5 #include <stdlib.hfa> 6 6 7 EHM_EXCEPTION(not_raised_exception)(); 8 9 EHM_VIRTUAL_TABLE(not_raised_exception, not_vt); 10 7 11 int main(int argc, char * argv[]) { 8 12 unsigned int times = 1; 9 unsigned int total_frames = 1;13 bool should_throw = false; 10 14 if (1 < argc) { 11 15 times = strtol(argv[1], 0p, 10); 12 }13 if (2 < argc) {14 total_frames = strtol(argv[2], 0p, 10);15 16 } 16 17 17 18 Time start_time = timeHiRes(); 18 19 for (unsigned int count = 0 ; count < times ; ++count) { 19 try { 20 // ... 20 try { 21 asm volatile ("# try block" : "=rm" (should_throw)); 22 if (should_throw) { 23 throw (not_raised_exception){¬_vt}; 24 } 21 25 } finally { 22 // ...26 asm volatile ("# finally block"); 23 27 } 24 28 }
Note: See TracChangeset
for help on using the changeset viewer.