ReactOS 0.4.15-dev-7842-g558ab78
pseh.c File Reference
#include <pseh/pseh2.h>
#include <wine/test.h>
Include dependency graph for pseh.c:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  volatile_context
 
struct  subtest
 

Macros

#define DEFINE_TEST(NAME_)   static int NAME_(void)
 
#define USE_TEST_NAME_(NAME_)   # NAME_
 
#define USE_TEST_NAME(NAME_)   USE_TEST_NAME_(NAME_)
 
#define USE_TEST(NAME_)   { USE_TEST_NAME(NAME_), NAME_ }
 

Functions

void no_op (void)
 
int return_arg (int)
 
int return_zero (void)
 
int return_positive (void)
 
int return_negative (void)
 
int return_one (void)
 
int return_minusone (void)
 
int return_zero_2 (void *)
 
int return_positive_2 (void *)
 
int return_negative_2 (void *)
 
int return_one_2 (void *)
 
int return_minusone_2 (void *)
 
int return_zero_3 (int)
 
int return_positive_3 (int)
 
int return_negative_3 (int)
 
int return_one_3 (int)
 
int return_minusone_3 (int)
 
int return_zero_4 (void *, int)
 
int return_positive_4 (void *, int)
 
int return_negative_4 (void *, int)
 
int return_one_4 (void *, int)
 
int return_minusone_4 (void *, int)
 
void set_positive (int *)
 
 DEFINE_TEST (test_empty_1)
 
 DEFINE_TEST (test_empty_2)
 
 DEFINE_TEST (test_empty_3)
 
 DEFINE_TEST (test_empty_4)
 
 DEFINE_TEST (test_empty_5)
 
 DEFINE_TEST (test_empty_6)
 
 DEFINE_TEST (test_empty_7)
 
 DEFINE_TEST (test_empty_8)
 
 DEFINE_TEST (test_execute_handler_1)
 
 DEFINE_TEST (test_continue_execution_1)
 
 DEFINE_TEST (test_continue_search_1)
 
 DEFINE_TEST (test_execute_handler_2)
 
 DEFINE_TEST (test_continue_execution_2)
 
 DEFINE_TEST (test_execute_handler_3)
 
 DEFINE_TEST (test_continue_execution_3)
 
 DEFINE_TEST (test_continue_search_2)
 
 DEFINE_TEST (test_execute_handler_4)
 
 DEFINE_TEST (test_continue_execution_4)
 
 DEFINE_TEST (test_execute_handler_5)
 
 DEFINE_TEST (test_continue_execution_5)
 
 DEFINE_TEST (test_continue_search_3)
 
 DEFINE_TEST (test_execute_handler_6)
 
 DEFINE_TEST (test_continue_execution_6)
 
 DEFINE_TEST (test_execute_handler_7)
 
 DEFINE_TEST (test_continue_execution_7)
 
 DEFINE_TEST (test_continue_search_4)
 
 DEFINE_TEST (test_execute_handler_8)
 
 DEFINE_TEST (test_continue_execution_8)
 
 DEFINE_TEST (test_execute_handler_9)
 
 DEFINE_TEST (test_continue_execution_9)
 
 DEFINE_TEST (test_continue_search_5)
 
 DEFINE_TEST (test_execute_handler_10)
 
 DEFINE_TEST (test_continue_execution_10)
 
 DEFINE_TEST (test_execute_handler_11)
 
 DEFINE_TEST (test_continue_execution_11)
 
 DEFINE_TEST (test_continue_search_6)
 
 DEFINE_TEST (test_execute_handler_12)
 
 DEFINE_TEST (test_continue_execution_12)
 
 DEFINE_TEST (test_leave_1)
 
 DEFINE_TEST (test_leave_2)
 
 DEFINE_TEST (test_leave_3)
 
 DEFINE_TEST (test_leave_4)
 
 DEFINE_TEST (test_leave_5)
 
 DEFINE_TEST (test_leave_6)
 
static int test_yield_1_helper (void)
 
 DEFINE_TEST (test_yield_1)
 
static int test_yield_2_helper (void)
 
 DEFINE_TEST (test_yield_2)
 
static int test_yield_3_helper (void)
 
 DEFINE_TEST (test_yield_3)
 
static int test_yield_4_helper (void)
 
 DEFINE_TEST (test_yield_4)
 
static int test_yield_5_helper (void)
 
 DEFINE_TEST (test_yield_5)
 
static int test_yield_6_helper (void)
 
 DEFINE_TEST (test_yield_6)
 
 DEFINE_TEST (test_finally_1)
 
 DEFINE_TEST (test_finally_2)
 
 DEFINE_TEST (test_finally_3)
 
static int test_finally_4_helper (void)
 
 DEFINE_TEST (test_finally_4)
 
 DEFINE_TEST (test_finally_5)
 
 DEFINE_TEST (test_finally_6)
 
 DEFINE_TEST (test_finally_7)
 
 DEFINE_TEST (test_finally_8)
 
static int test_finally_9_helper (void)
 
 DEFINE_TEST (test_finally_9)
 
 DEFINE_TEST (test_finally_10)
 
 DEFINE_TEST (test_finally_11)
 
 DEFINE_TEST (test_finally_12)
 
static void test_finally_13_helper (void)
 
 DEFINE_TEST (test_finally_13)
 
static void test_finally_14_helper (void)
 
 DEFINE_TEST (test_finally_14)
 
static int verify_xpointers (struct _EXCEPTION_POINTERS *ep, DWORD code, DWORD flags, DWORD argc, const ULONG_PTR *argv, int *ret, int filter)
 
 DEFINE_TEST (test_xpointers_1)
 
 DEFINE_TEST (test_xpointers_2)
 
 DEFINE_TEST (test_xpointers_3)
 
 DEFINE_TEST (test_xpointers_4)
 
 DEFINE_TEST (test_xpointers_5)
 
 DEFINE_TEST (test_xpointers_6)
 
 DEFINE_TEST (test_xpointers_7)
 
 DEFINE_TEST (test_xpointers_8)
 
 DEFINE_TEST (test_xpointers_9)
 
 DEFINE_TEST (test_xpointers_10)
 
 DEFINE_TEST (test_xpointers_11)
 
 DEFINE_TEST (test_xpointers_12)
 
 DEFINE_TEST (test_xpointers_13)
 
 DEFINE_TEST (test_xpointers_14)
 
 DEFINE_TEST (test_xpointers_15)
 
 DEFINE_TEST (test_xpointers_16)
 
static int verify_xcode (int code, int xcode, int *ret, int filter)
 
 DEFINE_TEST (test_xcode_1)
 
 DEFINE_TEST (test_xcode_2)
 
 DEFINE_TEST (test_xcode_3)
 
 DEFINE_TEST (test_abnorm_1)
 
 DEFINE_TEST (test_abnorm_2)
 
 DEFINE_TEST (test_abnorm_3)
 
 DEFINE_TEST (test_abnorm_4)
 
 DEFINE_TEST (test_abnorm_5)
 
 DEFINE_TEST (test_abnorm_6)
 
 DEFINE_TEST (test_abnorm_7)
 
 DEFINE_TEST (test_abnorm_8)
 
 DEFINE_TEST (test_nested_locals_1)
 
 DEFINE_TEST (test_nested_locals_2)
 
 DEFINE_TEST (test_nested_locals_3)
 
static void test_bug_4004_helper_1 (void)
 
static void test_bug_4004_helper_2 (void)
 
 DEFINE_TEST (test_bug_4004)
 
 DEFINE_TEST (test_bug_4663)
 
 DEFINE_TEST (test_unvolatile)
 
 DEFINE_TEST (test_unvolatile_2)
 
 DEFINE_TEST (test_unvolatile_3)
 
 DEFINE_TEST (test_unvolatile_4)
 
 DEFINE_TEST (test_finally_goto)
 
 DEFINE_TEST (test_nested_exception)
 
static LONG WINAPI unhandled_exception (PEXCEPTION_POINTERS ExceptionInfo)
 
static DECLSPEC_NOINLINE int sanity_check (int ret, struct volatile_context *before, struct volatile_context *after)
 
static int passthrough_handler (struct _EXCEPTION_RECORD *e, void *f, struct _CONTEXT *c, void *d)
 
static DECLSPEC_NOINLINE int call_test (int(*func)(void))
 
 DEFINE_TEST (test_PSEH3_bug)
 
void use_lots_of_stack (void)
 
 DEFINE_TEST (test_PSEH3_bug2)
 
 START_TEST (pseh)
 

Variables

static int test_yield_5_ret
 
static int test_yield_6_ret
 
static int test_finally_4_ret
 
static int test_finally_9_ret
 
static int test_finally_13_ret
 
static int test_finally_14_ret
 

Macro Definition Documentation

◆ DEFINE_TEST

#define DEFINE_TEST (   NAME_)    static int NAME_(void)

Definition at line 67 of file pseh.c.

◆ USE_TEST

#define USE_TEST (   NAME_)    { USE_TEST_NAME(NAME_), NAME_ }

Definition at line 2760 of file pseh.c.

◆ USE_TEST_NAME

#define USE_TEST_NAME (   NAME_)    USE_TEST_NAME_(NAME_)

Definition at line 2759 of file pseh.c.

◆ USE_TEST_NAME_

#define USE_TEST_NAME_ (   NAME_)    # NAME_

Definition at line 2758 of file pseh.c.

Function Documentation

◆ call_test()

static DECLSPEC_NOINLINE int call_test ( int(*)(void func)
static

Definition at line 2647 of file pseh.c.

2648{
2649 static int ret;
2650 static struct volatile_context before, after;
2651 static LPTOP_LEVEL_EXCEPTION_FILTER prev_unhandled_exception;
2652#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
2653 static _SEH2Registration_t * prev_frame;
2654 _SEH2Registration_t passthrough_frame;
2655#endif
2656
2657 prev_unhandled_exception = SetUnhandledExceptionFilter(&unhandled_exception);
2658
2659#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
2660 prev_frame = (_SEH2Registration_t *)__readfsdword(0);
2661 passthrough_frame.SER_Prev = prev_frame;
2662 passthrough_frame.SER_Handler = passthrough_handler;
2663 __writefsdword(0, (unsigned long)&passthrough_frame);
2664#endif
2665
2666#if defined(__GNUC__) && defined(__i386__)
2667 __asm__ __volatile__
2668 (
2669 "mov %%esp, 0x00 + %c[before]\n"
2670 "mov %%ebp, 0x04 + %c[before]\n"
2671 "mov %%ebx, 0x08 + %c[before]\n"
2672 "mov %%esi, 0x0c + %c[before]\n"
2673 "mov %%edi, 0x10 + %c[before]\n"
2674 "call *%[test]\n"
2675 "mov %%esp, 0x00 + %c[after]\n"
2676 "mov %%ebp, 0x04 + %c[after]\n"
2677 "mov %%ebx, 0x08 + %c[after]\n"
2678 "mov %%esi, 0x0c + %c[after]\n"
2679 "mov %%edi, 0x10 + %c[after]\n"
2680 "push %[after]\n"
2681 "push %[before]\n"
2682 "push %[ret]\n"
2683 "call %c[sanity_check]\n"
2684 "pop %%ecx\n"
2685 "pop %%ecx\n"
2686 "pop %%ecx\n" :
2687 [ret] "=a" (ret) :
2688 [test] "r" (func), [before] "i" (&before), [after] "i" (&after), [sanity_check] "i" (&sanity_check) :
2689 "ebx", "ecx", "edx", "esi", "edi", "flags", "memory"
2690 );
2691#else
2692 ret = func();
2693#endif
2694
2695#if defined(_X86_) && !defined(_PSEH3_H_) && !defined(_MSC_VER)
2696 if((_SEH2Registration_t *)__readfsdword(0) != &passthrough_frame || passthrough_frame.SER_Prev != prev_frame)
2697 {
2698 trace("exception registration list corrupted\n");
2699 ret = 0;
2700 }
2701
2702 __writefsdword(0, (unsigned long)prev_frame);
2703#endif
2704
2705 SetUnhandledExceptionFilter(prev_unhandled_exception);
2706 return ret;
2707}
#define trace
Definition: atltest.h:70
LPTOP_LEVEL_EXCEPTION_FILTER WINAPI DECLSPEC_HOTPATCH SetUnhandledExceptionFilter(IN LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
Definition: except.c:790
GLenum func
Definition: glext.h:6028
PPC_QUAL void __writefsdword(const unsigned long Offset, const unsigned long Data)
Definition: intrin_ppc.h:354
PPC_QUAL unsigned long __readfsdword(const unsigned long Offset)
Definition: intrin_ppc.h:382
__asm__(".p2align 4, 0x90\n" ".seh_proc __seh2_global_filter_func\n" "__seh2_global_filter_func:\n" "\tpush %rbp\n" "\t.seh_pushreg %rbp\n" "\tsub $32, %rsp\n" "\t.seh_stackalloc 32\n" "\t.seh_endprologue\n" "\tmov %rdx, %rbp\n" "\tjmp *%rax\n" "__seh2_global_filter_func_exit:\n" "\t.p2align 4\n" "\tadd $32, %rsp\n" "\tpop %rbp\n" "\tret\n" "\t.seh_endproc")
static LONG WINAPI unhandled_exception(PEXCEPTION_POINTERS ExceptionInfo)
Definition: pseh.c:2602
static int passthrough_handler(struct _EXCEPTION_RECORD *e, void *f, struct _CONTEXT *c, void *d)
Definition: pseh.c:2639
static DECLSPEC_NOINLINE int sanity_check(int ret, struct volatile_context *before, struct volatile_context *after)
Definition: pseh.c:2626
#define test
Definition: rosglue.h:37
__inline int before(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2390
__inline int after(__u32 seq1, __u32 seq2)
Definition: tcpcore.h:2395
int ret
PTOP_LEVEL_EXCEPTION_FILTER LPTOP_LEVEL_EXCEPTION_FILTER
Definition: winbase.h:1453

Referenced by START_TEST().

◆ DEFINE_TEST() [1/104]

DEFINE_TEST ( test_abnorm_1  )

Definition at line 2046 of file pseh.c.

2047{
2048 static int ret;
2049
2050 ret = return_zero();
2051
2052 _SEH2_TRY
2053 {
2054 ret = return_arg(ret);
2055 }
2057 {
2059 }
2060 _SEH2_END;
2061
2062 return ret == return_positive();
2063}
#define _SEH2_FINALLY
Definition: filesup.c:21
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
#define _SEH2_AbnormalTermination()
Definition: pseh2_64.h:160
int return_arg(int)
Definition: psehtest2.c:24
int return_zero(void)
Definition: psehtest2.c:35
int return_positive(void)
Definition: psehtest2.c:41

◆ DEFINE_TEST() [2/104]

DEFINE_TEST ( test_abnorm_2  )

Definition at line 2065 of file pseh.c.

2066{
2067 static int ret;
2068
2069 ret = return_zero();
2070
2071 _SEH2_TRY
2072 {
2074 }
2076 {
2078 }
2079 _SEH2_END;
2080
2081 return ret == return_positive();
2082}
#define _SEH2_LEAVE
Definition: filesup.c:20

◆ DEFINE_TEST() [3/104]

DEFINE_TEST ( test_abnorm_3  )

Definition at line 2084 of file pseh.c.

2085{
2086 static int ret;
2087
2088 ret = return_zero();
2089
2090 _SEH2_TRY
2091 {
2092 _SEH2_YIELD(goto leave);
2093 }
2095 {
2097 }
2098 _SEH2_END;
2099
2100leave:
2101 return ret == return_positive();
2102}
#define leave
Definition: btrfs_drv.h:138
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:162

◆ DEFINE_TEST() [4/104]

DEFINE_TEST ( test_abnorm_4  )

Definition at line 2104 of file pseh.c.

2105{
2106 static int ret;
2107
2108 ret = return_zero();
2109
2110 _SEH2_TRY
2111 {
2112 _SEH2_TRY
2113 {
2114 RaiseException(0xE00DEAD0, 0, 0, NULL);
2115 ret = return_zero();
2116 }
2118 {
2120 }
2121 _SEH2_END;
2122 }
2124 {
2125 ret = return_arg(ret);
2126 }
2127 _SEH2_END;
2128
2129 return ret == return_positive();
2130}
#define NULL
Definition: types.h:112
VOID WINAPI RaiseException(_In_ DWORD dwExceptionCode, _In_ DWORD dwExceptionFlags, _In_ DWORD nNumberOfArguments, _In_opt_ const ULONG_PTR *lpArguments)
Definition: except.c:700
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:34

◆ DEFINE_TEST() [5/104]

DEFINE_TEST ( test_abnorm_5  )

Definition at line 2132 of file pseh.c.

2133{
2134 static int ret;
2135
2136 ret = return_zero();
2137
2138 _SEH2_TRY
2139 {
2140 _SEH2_TRY
2141 {
2142 ret = return_arg(ret);
2143 }
2145 {
2147 }
2148 _SEH2_END;
2149 }
2151 {
2153 }
2154 _SEH2_END;
2155
2156 return ret == return_positive() + return_one();
2157}
int return_one(void)
Definition: psehtest2.c:53

◆ DEFINE_TEST() [6/104]

DEFINE_TEST ( test_abnorm_6  )

Definition at line 2159 of file pseh.c.

2160{
2161 static int ret;
2162
2163 ret = return_zero();
2164
2165 _SEH2_TRY
2166 {
2167 _SEH2_TRY
2168 {
2170 }
2172 {
2174 }
2175 _SEH2_END;
2176 }
2178 {
2180 }
2181 _SEH2_END;
2182
2183 return ret == return_positive() + return_one();
2184}

◆ DEFINE_TEST() [7/104]

DEFINE_TEST ( test_abnorm_7  )

Definition at line 2186 of file pseh.c.

2187{
2188 static int ret;
2189
2190 ret = return_zero();
2191
2192 _SEH2_TRY
2193 {
2194 _SEH2_TRY
2195 {
2196 _SEH2_YIELD(goto leave);
2197 }
2199 {
2201 }
2202 _SEH2_END;
2203 }
2205 {
2207 }
2208 _SEH2_END;
2209
2210leave:
2211 return ret == return_positive() + return_one();
2212}

◆ DEFINE_TEST() [8/104]

DEFINE_TEST ( test_abnorm_8  )

Definition at line 2214 of file pseh.c.

2215{
2216 static int ret;
2217
2218 ret = return_zero();
2219
2220 _SEH2_TRY
2221 {
2222 _SEH2_TRY
2223 {
2224 _SEH2_TRY
2225 {
2226 RaiseException(0xE00DEAD0, 0, 0, NULL);
2227 ret = return_zero();
2228 }
2230 {
2232 }
2233 _SEH2_END;
2234 }
2236 {
2238 }
2239 _SEH2_END;
2240 }
2242 {
2243 ret = return_arg(ret);
2244 }
2245 _SEH2_END;
2246
2247 return ret == return_positive() + return_one();
2248}

◆ DEFINE_TEST() [9/104]

DEFINE_TEST ( test_bug_4004  )

Definition at line 2359 of file pseh.c.

2360{
2361 int i1, i2, i3;
2362
2363 i1 = return_positive();
2364 i2 = return_positive();
2365 i3 = return_positive();
2366
2368
2369 return return_arg(i1) + return_arg(i2) + return_arg(i3) == return_positive() * 3;
2370}
static void test_bug_4004_helper_2(void)
Definition: pseh.c:2347

◆ DEFINE_TEST() [10/104]

DEFINE_TEST ( test_bug_4663  )

Definition at line 2374 of file pseh.c.

2375{
2376 int i1, i2;
2377
2378 i1 = return_positive();
2379 i2 = return_positive();
2380
2381 _SEH2_TRY
2382 {
2383 _SEH2_TRY
2384 {
2385 RaiseException(0xE00DEAD0, 0, 0, 0);
2386 }
2388 {
2389 if (i1 == return_positive())
2390 {
2391 i1 = return_positive() + 1;
2392 }
2393 }
2394 _SEH2_END;
2395
2396 if (i1 == return_positive() + 1)
2397 {
2398 i1 = return_negative();
2399 RaiseException(0xE00DEAD0, 0, 0, 0);
2400 }
2401 }
2403 {
2404 i2 = return_negative();
2405 }
2406 _SEH2_END;
2407
2408 return ((i1 == return_negative()) && (i2 == return_negative()));
2409}
int return_negative(void)
Definition: psehtest2.c:47

◆ DEFINE_TEST() [11/104]

DEFINE_TEST ( test_continue_execution_1  )

Definition at line 140 of file pseh.c.

141{
142 static int ret;
143
144 ret = return_zero();
145
147 {
148 RaiseException(0xE00DEAD0, 0, 0, NULL);
150 }
152 {
153 ret = return_zero();
154 }
155 _SEH2_END;
156
157 return ret == return_positive();
158}
#define EXCEPTION_CONTINUE_EXECUTION
Definition: excpt.h:87

◆ DEFINE_TEST() [12/104]

DEFINE_TEST ( test_continue_execution_10  )

Definition at line 648 of file pseh.c.

649{
650 static int ret;
651
652 ret = return_zero();
653
655 {
656 RaiseException(0xE00DEAD0, 0, 0, NULL);
658 }
660 {
661 ret = return_zero();
662 }
663 _SEH2_END;
664
665 return ret == return_positive();
666}
#define _SEH2_GetExceptionCode()
Definition: pseh2_64.h:159
#define _SEH2_GetExceptionInformation()
Definition: pseh2_64.h:158
int return_negative_4(void *, int)
Definition: psehtest2.c:137

◆ DEFINE_TEST() [13/104]

DEFINE_TEST ( test_continue_execution_11  )

Definition at line 690 of file pseh.c.

691{
692 static int ret;
693
694 ret = return_zero();
695
697 {
698 RaiseException(0xE00DEAD0, 0, 0, NULL);
700 }
702 {
703 ret = return_zero();
704 }
705 _SEH2_END;
706
707 return ret == return_positive();
708}
void set_positive(int *)
Definition: psehtest2.c:155

◆ DEFINE_TEST() [14/104]

DEFINE_TEST ( test_continue_execution_12  )

Definition at line 763 of file pseh.c.

764{
765 static int ret;
766
767 ret = return_zero();
768
770 {
771 RaiseException(0xE00DEAD0, 0, 0, NULL);
772 ret = return_arg(ret);
773 }
774 _SEH2_EXCEPT(set_positive(&ret), -12345)
775 {
776 ret = return_zero();
777 }
778 _SEH2_END;
779
780 return ret == return_positive();
781}

◆ DEFINE_TEST() [15/104]

DEFINE_TEST ( test_continue_execution_2  )

Definition at line 208 of file pseh.c.

209{
210 static int ret;
211
212 ret = return_zero();
213
215 {
216 RaiseException(0xE00DEAD0, 0, 0, NULL);
218 }
219 _SEH2_EXCEPT(-12345)
220 {
221 ret = return_zero();
222 }
223 _SEH2_END;
224
225 return ret == return_positive();
226}

◆ DEFINE_TEST() [16/104]

DEFINE_TEST ( test_continue_execution_3  )

Definition at line 250 of file pseh.c.

251{
252 static int ret;
253
254 ret = return_zero();
255
257 {
258 RaiseException(0xE00DEAD0, 0, 0, NULL);
260 }
262 {
263 ret = return_zero();
264 }
265 _SEH2_END;
266
267 return ret == return_positive();
268}
int return_minusone(void)
Definition: psehtest2.c:59

◆ DEFINE_TEST() [17/104]

DEFINE_TEST ( test_continue_execution_4  )

Definition at line 318 of file pseh.c.

319{
320 static int ret;
321
322 ret = return_zero();
323
325 {
326 RaiseException(0xE00DEAD0, 0, 0, NULL);
328 }
330 {
331 ret = return_zero();
332 }
333 _SEH2_END;
334
335 return ret == return_positive();
336}

◆ DEFINE_TEST() [18/104]

DEFINE_TEST ( test_continue_execution_5  )

Definition at line 360 of file pseh.c.

361{
362 static int ret;
363
364 ret = return_zero();
365
367 {
368 RaiseException(0xE00DEAD0, 0, 0, NULL);
370 }
372 {
373 ret = return_zero();
374 }
375 _SEH2_END;
376
377 return ret == return_positive();
378}
int return_minusone_2(void *)
Definition: psehtest2.c:89

◆ DEFINE_TEST() [19/104]

DEFINE_TEST ( test_continue_execution_6  )

Definition at line 428 of file pseh.c.

429{
430 static int ret;
431
432 ret = return_zero();
433
435 {
436 RaiseException(0xE00DEAD0, 0, 0, NULL);
438 }
440 {
441 ret = return_zero();
442 }
443 _SEH2_END;
444
445 return ret == return_positive();
446}
int return_negative_2(void *)
Definition: psehtest2.c:77

◆ DEFINE_TEST() [20/104]

DEFINE_TEST ( test_continue_execution_7  )

Definition at line 470 of file pseh.c.

471{
472 static int ret;
473
474 ret = return_zero();
475
477 {
478 RaiseException(0xE00DEAD0, 0, 0, NULL);
480 }
482 {
483 ret = return_zero();
484 }
485 _SEH2_END;
486
487 return ret == return_positive();
488}
int return_minusone_3(int)
Definition: psehtest2.c:119

◆ DEFINE_TEST() [21/104]

DEFINE_TEST ( test_continue_execution_8  )

Definition at line 538 of file pseh.c.

539{
540 static int ret;
541
542 ret = return_zero();
543
545 {
546 RaiseException(0xE00DEAD0, 0, 0, NULL);
548 }
550 {
551 ret = return_zero();
552 }
553 _SEH2_END;
554
555 return ret == return_positive();
556}
int return_negative_3(int)
Definition: psehtest2.c:107

◆ DEFINE_TEST() [22/104]

DEFINE_TEST ( test_continue_execution_9  )

Definition at line 580 of file pseh.c.

581{
582 static int ret;
583
584 ret = return_zero();
585
587 {
588 RaiseException(0xE00DEAD0, 0, 0, NULL);
590 }
592 {
593 ret = return_zero();
594 }
595 _SEH2_END;
596
597 return ret == return_positive();
598}
int return_minusone_4(void *, int)
Definition: psehtest2.c:149

◆ DEFINE_TEST() [23/104]

DEFINE_TEST ( test_continue_search_1  )

Definition at line 160 of file pseh.c.

161{
162 static int ret;
163
164 ret = return_zero();
165
167 {
169 {
170 RaiseException(0xE00DEAD0, 0, 0, NULL);
171 ret = return_zero();
172 }
174 {
175 ret = return_zero();
176 }
177 _SEH2_END;
178 }
180 {
182 }
183 _SEH2_END;
184
185 return ret == return_positive();
186}
#define EXCEPTION_CONTINUE_SEARCH
Definition: excpt.h:86

◆ DEFINE_TEST() [24/104]

DEFINE_TEST ( test_continue_search_2  )

Definition at line 270 of file pseh.c.

271{
272 static int ret;
273
274 ret = return_zero();
275
277 {
279 {
280 RaiseException(0xE00DEAD0, 0, 0, NULL);
281 ret = return_zero();
282 }
284 {
285 ret = return_zero();
286 }
287 _SEH2_END;
288 }
290 {
292 }
293 _SEH2_END;
294
295 return ret == return_positive();
296}

◆ DEFINE_TEST() [25/104]

DEFINE_TEST ( test_continue_search_3  )

Definition at line 380 of file pseh.c.

381{
382 static int ret;
383
385
387 {
389 {
390 RaiseException(0xE00DEAD0, 0, 0, NULL);
391 ret = return_zero();
392 }
394 {
395 ret = return_zero();
396 }
397 _SEH2_END;
398 }
400 {
401 ret = return_arg(ret);
402 }
403 _SEH2_END;
404
405 return ret == return_positive();
406}
int return_zero_2(void *)
Definition: psehtest2.c:65

◆ DEFINE_TEST() [26/104]

DEFINE_TEST ( test_continue_search_4  )

Definition at line 490 of file pseh.c.

491{
492 static int ret;
493
494 ret = return_zero();
495
497 {
499 {
500 RaiseException(0xE00DEAD0, 0, 0, NULL);
501 ret = return_zero();
502 }
504 {
505 ret = return_zero();
506 }
507 _SEH2_END;
508 }
510 {
512 }
513 _SEH2_END;
514
515 return ret == return_positive();
516}
int return_zero_3(int)
Definition: psehtest2.c:95

◆ DEFINE_TEST() [27/104]

DEFINE_TEST ( test_continue_search_5  )

Definition at line 600 of file pseh.c.

601{
602 static int ret;
603
604 ret = return_zero();
605
607 {
609 {
610 RaiseException(0xE00DEAD0, 0, 0, NULL);
611 ret = return_zero();
612 }
614 {
615 ret = return_zero();
616 }
617 _SEH2_END;
618 }
620 {
622 }
623 _SEH2_END;
624
625 return ret == return_positive();
626}
int return_zero_4(void *, int)
Definition: psehtest2.c:125

◆ DEFINE_TEST() [28/104]

DEFINE_TEST ( test_continue_search_6  )

Definition at line 710 of file pseh.c.

711{
712 static int ret;
713 static int ret2;
714
715 ret = return_zero();
716 ret2 = return_zero();
717
719 {
721 {
722 RaiseException(0xE00DEAD0, 0, 0, NULL);
723 ret = return_zero();
724 ret2 = return_zero();
725 }
727 {
728 ret = return_zero();
729 ret2 = return_zero();
730 }
731 _SEH2_END;
732 }
734 {
735 ret = return_arg(ret);
736 ret2 = return_arg(ret2);
737 }
738 _SEH2_END;
739
740 return ret == return_positive() && ret2 == return_positive();
741}

◆ DEFINE_TEST() [29/104]

DEFINE_TEST ( test_empty_1  )

Definition at line 70 of file pseh.c.

71{
73 return 1;
74}

◆ DEFINE_TEST() [30/104]

DEFINE_TEST ( test_empty_2  )

Definition at line 76 of file pseh.c.

77{
79 return 1;
80}

◆ DEFINE_TEST() [31/104]

DEFINE_TEST ( test_empty_3  )

Definition at line 82 of file pseh.c.

83{
85 return 1;
86}

◆ DEFINE_TEST() [32/104]

DEFINE_TEST ( test_empty_4  )

Definition at line 88 of file pseh.c.

89{
91 return 1;
92}

◆ DEFINE_TEST() [33/104]

DEFINE_TEST ( test_empty_5  )

Definition at line 94 of file pseh.c.

95{
97 return 1;
98}

◆ DEFINE_TEST() [34/104]

DEFINE_TEST ( test_empty_6  )

Definition at line 100 of file pseh.c.

101{
103 return 1;
104}

◆ DEFINE_TEST() [35/104]

DEFINE_TEST ( test_empty_7  )

Definition at line 106 of file pseh.c.

107{
109 return 1;
110}

◆ DEFINE_TEST() [36/104]

DEFINE_TEST ( test_empty_8  )

Definition at line 112 of file pseh.c.

113{
115 return 1;
116}

◆ DEFINE_TEST() [37/104]

DEFINE_TEST ( test_execute_handler_1  )

Definition at line 120 of file pseh.c.

121{
122 static int ret;
123
124 ret = return_zero();
125
127 {
128 RaiseException(0xE00DEAD0, 0, 0, NULL);
129 ret = return_zero();
130 }
132 {
134 }
135 _SEH2_END;
136
137 return ret == return_positive();
138}

◆ DEFINE_TEST() [38/104]

DEFINE_TEST ( test_execute_handler_10  )

Definition at line 628 of file pseh.c.

629{
630 static int ret;
631
632 ret = return_zero();
633
635 {
636 RaiseException(0xE00DEAD0, 0, 0, NULL);
637 ret = return_zero();
638 }
640 {
642 }
643 _SEH2_END;
644
645 return ret == return_positive();
646}
int return_positive_4(void *, int)
Definition: psehtest2.c:131

◆ DEFINE_TEST() [39/104]

DEFINE_TEST ( test_execute_handler_11  )

Definition at line 670 of file pseh.c.

671{
672 static int ret;
673
674 ret = return_zero();
675
677 {
678 RaiseException(0xE00DEAD0, 0, 0, NULL);
679 ret = return_zero();
680 }
682 {
684 }
685 _SEH2_END;
686
687 return ret == return_positive();
688}

◆ DEFINE_TEST() [40/104]

DEFINE_TEST ( test_execute_handler_12  )

Definition at line 743 of file pseh.c.

744{
745 static int ret;
746
747 ret = return_zero();
748
750 {
751 RaiseException(0xE00DEAD0, 0, 0, NULL);
752 ret = return_zero();
753 }
755 {
756 ret = return_arg(ret);
757 }
758 _SEH2_END;
759
760 return ret == return_positive();
761}

◆ DEFINE_TEST() [41/104]

DEFINE_TEST ( test_execute_handler_2  )

Definition at line 188 of file pseh.c.

189{
190 static int ret;
191
192 ret = return_zero();
193
195 {
196 RaiseException(0xE00DEAD0, 0, 0, NULL);
197 ret = return_zero();
198 }
199 _SEH2_EXCEPT(12345)
200 {
202 }
203 _SEH2_END;
204
205 return ret == return_positive();
206}

◆ DEFINE_TEST() [42/104]

DEFINE_TEST ( test_execute_handler_3  )

Definition at line 230 of file pseh.c.

231{
232 static int ret;
233
234 ret = return_zero();
235
237 {
238 RaiseException(0xE00DEAD0, 0, 0, NULL);
239 ret = return_zero();
240 }
242 {
244 }
245 _SEH2_END;
246
247 return ret == return_positive();
248}

◆ DEFINE_TEST() [43/104]

DEFINE_TEST ( test_execute_handler_4  )

Definition at line 298 of file pseh.c.

299{
300 static int ret;
301
302 ret = return_zero();
303
305 {
306 RaiseException(0xE00DEAD0, 0, 0, NULL);
307 ret = return_zero();
308 }
310 {
312 }
313 _SEH2_END;
314
315 return ret == return_positive();
316}

◆ DEFINE_TEST() [44/104]

DEFINE_TEST ( test_execute_handler_5  )

Definition at line 340 of file pseh.c.

341{
342 static int ret;
343
344 ret = return_zero();
345
347 {
348 RaiseException(0xE00DEAD0, 0, 0, NULL);
349 ret = return_zero();
350 }
352 {
354 }
355 _SEH2_END;
356
357 return ret == return_positive();
358}
int return_one_2(void *)
Definition: psehtest2.c:83

◆ DEFINE_TEST() [45/104]

DEFINE_TEST ( test_execute_handler_6  )

Definition at line 408 of file pseh.c.

409{
410 static int ret;
411
412 ret = return_zero();
413
415 {
416 RaiseException(0xE00DEAD0, 0, 0, NULL);
417 ret = return_zero();
418 }
420 {
422 }
423 _SEH2_END;
424
425 return ret == return_positive();
426}
int return_positive_2(void *)
Definition: psehtest2.c:71

◆ DEFINE_TEST() [46/104]

DEFINE_TEST ( test_execute_handler_7  )

Definition at line 450 of file pseh.c.

451{
452 static int ret;
453
454 ret = return_zero();
455
457 {
458 RaiseException(0xE00DEAD0, 0, 0, NULL);
459 ret = return_zero();
460 }
462 {
464 }
465 _SEH2_END;
466
467 return ret == return_positive();
468}
int return_one_3(int)
Definition: psehtest2.c:113

◆ DEFINE_TEST() [47/104]

DEFINE_TEST ( test_execute_handler_8  )

Definition at line 518 of file pseh.c.

519{
520 static int ret;
521
522 ret = return_zero();
523
525 {
526 RaiseException(0xE00DEAD0, 0, 0, NULL);
527 ret = return_zero();
528 }
530 {
532 }
533 _SEH2_END;
534
535 return ret == return_positive();
536}
int return_positive_3(int)
Definition: psehtest2.c:101

◆ DEFINE_TEST() [48/104]

DEFINE_TEST ( test_execute_handler_9  )

Definition at line 560 of file pseh.c.

561{
562 static int ret;
563
564 ret = return_zero();
565
567 {
568 RaiseException(0xE00DEAD0, 0, 0, NULL);
569 ret = return_zero();
570 }
572 {
574 }
575 _SEH2_END;
576
577 return ret == return_positive();
578}
int return_one_4(void *, int)
Definition: psehtest2.c:143

◆ DEFINE_TEST() [49/104]

DEFINE_TEST ( test_finally_1  )

Definition at line 1107 of file pseh.c.

1108{
1109 static int ret;
1110
1111 ret = return_zero();
1112
1113 _SEH2_TRY
1114 {
1115 ret = return_arg(ret);
1116 }
1118 {
1119 ret = return_positive();
1120 }
1121 _SEH2_END;
1122
1123 return ret == return_positive();
1124}

◆ DEFINE_TEST() [50/104]

DEFINE_TEST ( test_finally_10  )

Definition at line 1345 of file pseh.c.

1346{
1347 static int ret;
1348
1349 ret = return_zero();
1350
1351 _SEH2_TRY
1352 {
1353 _SEH2_TRY
1354 {
1355 _SEH2_TRY
1356 {
1357 RaiseException(0xE00DEAD0, 0, 0, NULL);
1358 ret = return_zero();
1359 }
1361 {
1362 if(ret == return_zero())
1363 ret = return_positive();
1364 }
1365 _SEH2_END;
1366 }
1368 {
1369 if(ret == return_positive())
1371 }
1372 _SEH2_END;
1373 }
1375 {
1376 ret = return_arg(ret);
1377 }
1378 _SEH2_END;
1379
1380 return ret == return_positive() + return_one();
1381}

◆ DEFINE_TEST() [51/104]

DEFINE_TEST ( test_finally_11  )

Definition at line 1383 of file pseh.c.

1384{
1385 static int ret;
1386
1387 ret = return_zero();
1388
1389 _SEH2_TRY
1390 {
1391 _SEH2_TRY
1392 {
1393 _SEH2_TRY
1394 {
1395 ret = return_arg(ret);
1396 }
1398 {
1399 ret = return_zero();
1400 }
1401 _SEH2_END;
1402 }
1404 {
1405 ret = return_positive();
1406 RaiseException(0xE00DEAD0, 0, 0, NULL);
1407 ret = return_zero();
1408 }
1409 _SEH2_END;
1410 }
1412 {
1413 if(ret == return_positive())
1414 ret += return_one();
1415 }
1416 _SEH2_END;
1417
1418 return ret == return_positive() + return_one();
1419}

◆ DEFINE_TEST() [52/104]

DEFINE_TEST ( test_finally_12  )

Definition at line 1421 of file pseh.c.

1422{
1423 static int ret;
1424
1425 ret = return_zero();
1426
1427 _SEH2_TRY
1428 {
1429 _SEH2_TRY
1430 {
1431 _SEH2_TRY
1432 {
1433 ret = return_arg(ret);
1434 }
1436 {
1437 ret = return_positive();
1438 RaiseException(0xE00DEAD0, 0, 0, NULL);
1439 ret = return_zero();
1440 }
1441 _SEH2_END;
1442 }
1444 {
1445 if(ret == return_positive())
1446 ret += return_one();
1447 }
1448 _SEH2_END;
1449 }
1451 {
1452 if(ret == return_positive() + return_one())
1453 ret += return_one();
1454 }
1455 _SEH2_END;
1456
1457 return ret == return_positive() + return_one() + return_one();
1458}

◆ DEFINE_TEST() [53/104]

DEFINE_TEST ( test_finally_13  )

Definition at line 1495 of file pseh.c.

1496{
1497 static int ret;
1498
1499 ret = return_zero();
1500
1501 _SEH2_TRY
1502 {
1503 ret = return_arg(ret);
1505 ret = return_zero();
1506 }
1508 {
1509 ret = return_positive();
1510 }
1511 _SEH2_END;
1512
1514}
static void test_finally_13_helper(void)
Definition: pseh.c:1463
static int test_finally_13_ret
Definition: pseh.c:1460

◆ DEFINE_TEST() [54/104]

DEFINE_TEST ( test_finally_14  )

Definition at line 1560 of file pseh.c.

1561{
1562 static int ret;
1563
1564 ret = return_zero();
1565
1566 _SEH2_TRY
1567 {
1568 ret = return_arg(ret);
1570 ret = return_positive();
1571 }
1573 {
1574 ret = return_zero();
1575 }
1576 _SEH2_END;
1577
1579}
static void test_finally_14_helper(void)
Definition: pseh.c:1519
static int test_finally_14_ret
Definition: pseh.c:1516

◆ DEFINE_TEST() [55/104]

DEFINE_TEST ( test_finally_2  )

Definition at line 1126 of file pseh.c.

1127{
1128 static int ret;
1129
1130 ret = return_zero();
1131
1132 _SEH2_TRY
1133 {
1134 ret = return_arg(ret);
1136 }
1138 {
1139 ret = return_positive();
1140 }
1141 _SEH2_END;
1142
1143 return ret == return_positive();
1144}

◆ DEFINE_TEST() [56/104]

DEFINE_TEST ( test_finally_3  )

Definition at line 1146 of file pseh.c.

1147{
1148 static int ret;
1149
1150 ret = return_zero();
1151
1152 _SEH2_TRY
1153 {
1154 ret = return_arg(ret);
1155 _SEH2_YIELD(goto leave);
1156 }
1158 {
1159 ret = return_positive();
1160 }
1161 _SEH2_END;
1162
1163leave:
1164 return ret == return_positive();
1165}

◆ DEFINE_TEST() [57/104]

DEFINE_TEST ( test_finally_4  )

Definition at line 1187 of file pseh.c.

1188{
1190}
static int test_finally_4_helper(void)
Definition: pseh.c:1169
static int test_finally_4_ret
Definition: pseh.c:1167

◆ DEFINE_TEST() [58/104]

DEFINE_TEST ( test_finally_5  )

Definition at line 1192 of file pseh.c.

1193{
1194 static int ret;
1195
1196 ret = return_zero();
1197
1198 _SEH2_TRY
1199 {
1200 _SEH2_TRY
1201 {
1202 RaiseException(0xE00DEAD0, 0, 0, NULL);
1203 ret = return_zero();
1204 }
1206 {
1207 ret = return_positive();
1208 }
1209 _SEH2_END;
1210 }
1212 {
1213 ret = return_arg(ret);
1214 }
1215 _SEH2_END;
1216
1217 return ret == return_positive();
1218}

◆ DEFINE_TEST() [59/104]

DEFINE_TEST ( test_finally_6  )

Definition at line 1220 of file pseh.c.

1221{
1222 static int ret;
1223
1224 ret = return_zero();
1225
1226 _SEH2_TRY
1227 {
1228 _SEH2_TRY
1229 {
1230 ret = return_arg(ret);
1231 }
1233 {
1234 if(ret == return_zero())
1235 ret = return_positive();
1236 }
1237 _SEH2_END;
1238 }
1240 {
1241 if(ret == return_positive())
1243 }
1244 _SEH2_END;
1245
1246 return ret == return_positive() + return_one();
1247}

◆ DEFINE_TEST() [60/104]

DEFINE_TEST ( test_finally_7  )

Definition at line 1249 of file pseh.c.

1250{
1251 static int ret;
1252
1253 ret = return_zero();
1254
1255 _SEH2_TRY
1256 {
1257 _SEH2_TRY
1258 {
1259 ret = return_arg(ret);
1261 }
1263 {
1264 if(ret == return_zero())
1265 ret = return_positive();
1266 }
1267 _SEH2_END;
1268 }
1270 {
1271 if(ret == return_positive())
1273 }
1274 _SEH2_END;
1275
1276 return ret == return_positive() + return_one();
1277}

◆ DEFINE_TEST() [61/104]

DEFINE_TEST ( test_finally_8  )

Definition at line 1279 of file pseh.c.

1280{
1281 static int ret;
1282
1283 ret = return_zero();
1284
1285 _SEH2_TRY
1286 {
1287 _SEH2_TRY
1288 {
1289 ret = return_arg(ret);
1290 _SEH2_YIELD(goto leave);
1291 }
1293 {
1294 if(ret == return_zero())
1295 ret = return_positive();
1296 }
1297 _SEH2_END;
1298 }
1300 {
1301 if(ret == return_positive())
1303 }
1304 _SEH2_END;
1305
1306leave:
1307 return ret == return_positive() + return_one();
1308}

◆ DEFINE_TEST() [62/104]

DEFINE_TEST ( test_finally_9  )

Definition at line 1340 of file pseh.c.

1341{
1343}
static int test_finally_9_helper(void)
Definition: pseh.c:1312
static int test_finally_9_ret
Definition: pseh.c:1310

◆ DEFINE_TEST() [63/104]

DEFINE_TEST ( test_finally_goto  )

Definition at line 2532 of file pseh.c.

2533{
2534 volatile int val = 0;
2535
2536 _SEH2_TRY
2537 {
2538 val |= 1;
2539 _SEH2_TRY
2540 {
2541 val |= 2;
2542 goto next;
2543 }
2545 {
2546 val |= 4;
2547 *((char*)(intptr_t)0xdeadc0de) = 0;
2548 val |= 8;
2549 }
2550 _SEH2_END;
2551
2552 val |= 16;
2553next:
2554 val |= 32;
2555 *((char*)(intptr_t)0xdeadc0de) = 0;
2556 val |= 64;
2557 }
2558 _SEH2_EXCEPT(1)
2559 {
2560 val |= 128;
2561 }
2562 _SEH2_END;
2563
2564 return (val == (128|4|2|1));
2565}
int intptr_t
Definition: crtdefs.h:304
GLuint GLfloat * val
Definition: glext.h:7180
static unsigned __int64 next
Definition: rand_nt.c:6

◆ DEFINE_TEST() [64/104]

DEFINE_TEST ( test_leave_1  )

Definition at line 785 of file pseh.c.

786{
787 static int ret;
788
789 ret = return_zero();
790
792 {
795 ret = return_zero();
796 }
798 {
799 ret = return_zero();
800 }
801 _SEH2_END;
802
803 return ret == return_positive();
804}

◆ DEFINE_TEST() [65/104]

DEFINE_TEST ( test_leave_2  )

Definition at line 806 of file pseh.c.

807{
808 static int ret;
809
810 ret = return_zero();
811
813 {
816
817 RaiseException(0xE00DEAD0, 0, 0, NULL);
818 ret = return_zero();
819 }
821 {
822 ret = return_zero();
823 }
824 _SEH2_END;
825
826 return ret == return_positive();
827}

◆ DEFINE_TEST() [66/104]

DEFINE_TEST ( test_leave_3  )

Definition at line 829 of file pseh.c.

830{
831 static int ret;
832
833 ret = return_zero();
834
836 {
838
839 if(return_one())
841
842 ret = return_zero();
843 }
845 {
846 ret = return_zero();
847 }
848 _SEH2_END;
849
850 return ret == return_positive();
851}

◆ DEFINE_TEST() [67/104]

DEFINE_TEST ( test_leave_4  )

Definition at line 853 of file pseh.c.

854{
855 static int ret;
856
857 ret = return_zero();
858
860 {
861 int i;
862 int n = return_one() + return_one();
863
864 for(i = return_zero(); i < n; ++ i)
865 {
866 if(i == return_one())
867 {
870 }
871 }
872
873 ret = return_zero();
874 }
876 {
877 ret = return_zero();
878 }
879 _SEH2_END;
880
881 return ret == return_positive();
882}
GLdouble n
Definition: glext.h:7729
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248

◆ DEFINE_TEST() [68/104]

DEFINE_TEST ( test_leave_5  )

Definition at line 884 of file pseh.c.

885{
886 static int ret;
887
888 ret = return_zero();
889
891 {
892 switch(return_one())
893 {
894 case 0: ret = return_zero();
895 case 1: ret = return_positive(); _SEH2_LEAVE;
896 case 2: ret = return_zero();
897 }
898
899 ret = return_zero();
900 }
902 {
903 ret = return_zero();
904 }
905 _SEH2_END;
906
907 return ret == return_positive();
908}

◆ DEFINE_TEST() [69/104]

DEFINE_TEST ( test_leave_6  )

Definition at line 910 of file pseh.c.

911{
912 static int ret;
913
914 ret = return_zero();
915
917 {
919 {
921 }
923 {
924 ret = return_zero();
925 }
926 _SEH2_END;
927
929 }
931 {
932 ret = return_zero();
933 }
934 _SEH2_END;
935
936 return ret == return_positive();
937}

◆ DEFINE_TEST() [70/104]

DEFINE_TEST ( test_nested_exception  )

Definition at line 2567 of file pseh.c.

2568{
2569 volatile int val = 0;
2570
2571 _SEH2_TRY
2572 {
2573 val |= 1;
2574 _SEH2_TRY
2575 {
2576 val |= 2;
2577 *((char*)(intptr_t)0xdeadc0de) = 0;
2578 val |= 4;
2579 }
2580 _SEH2_EXCEPT(1)
2581 {
2582 val |= 8;
2583 *((char*)(intptr_t)0xdeadc0de) = 0;
2584 val |= 16;
2585 }
2586 _SEH2_END;
2587
2588 val |= 32;
2589 *((char*)(intptr_t)0xdeadc0de) = 0;
2590 val |= 64;
2591 }
2592 _SEH2_EXCEPT(1)
2593 {
2594 val |= 128;
2595 }
2596 _SEH2_END;
2597
2598 return (val == (1|2|8|128));
2599}

◆ DEFINE_TEST() [71/104]

DEFINE_TEST ( test_nested_locals_1  )

Definition at line 2252 of file pseh.c.

2253{
2254 int var1 = return_one();
2255
2256 _SEH2_TRY
2257 {
2258 RaiseException(0xE00DEAD0, 0, 0, 0);
2259 }
2260 _SEH2_EXCEPT((var1 = (var1 == return_one() ? return_positive() : var1)), EXCEPTION_EXECUTE_HANDLER)
2261 {
2262 if(var1 == return_positive())
2263 var1 = return_positive() + 1;
2264 }
2265 _SEH2_END;
2266
2267 return var1 == return_positive() + 1;
2268}

◆ DEFINE_TEST() [72/104]

DEFINE_TEST ( test_nested_locals_2  )

Definition at line 2270 of file pseh.c.

2271{
2272 int var1 = return_positive();
2273
2274 _SEH2_TRY
2275 {
2276 }
2278 {
2279 if(var1 == return_positive())
2280 var1 = return_positive() + 1;
2281 }
2282 _SEH2_END;
2283
2284 return var1 == return_positive() + 1;
2285}

◆ DEFINE_TEST() [73/104]

DEFINE_TEST ( test_nested_locals_3  )

Definition at line 2287 of file pseh.c.

2288{
2289 int var1 = return_zero();
2290
2291 _SEH2_TRY
2292 {
2293 _SEH2_TRY
2294 {
2295 var1 = return_one();
2296 RaiseException(0xE00DEAD0, 0, 0, 0);
2297 }
2299 {
2300 if(var1 == return_one())
2301 var1 = return_positive();
2302 }
2303 _SEH2_END;
2304 }
2306 {
2307 if(var1 == return_positive())
2308 var1 = return_positive() + 1;
2309 }
2310 _SEH2_END;
2311
2312 return var1 == return_positive() + 1;
2313}

◆ DEFINE_TEST() [74/104]

DEFINE_TEST ( test_PSEH3_bug  )

Definition at line 2709 of file pseh.c.

2710{
2711 volatile int count = 0;
2712 int dummy = 0;
2713
2714 _SEH2_TRY
2715 {
2716 if (count++ == 0)
2717 {
2718 *(volatile int*)0x12345678 = 0x12345678;
2719 }
2720 }
2722 {
2723 dummy = 0;
2724 }
2725 _SEH2_END;
2726
2727 (void)dummy;
2728 return (count == 1);
2729}
GLuint GLuint GLsizei count
Definition: gl.h:1545

◆ DEFINE_TEST() [75/104]

DEFINE_TEST ( test_PSEH3_bug2  )

Definition at line 2741 of file pseh.c.

2742{
2743 unsigned long status = 0;
2744 _SEH2_TRY
2745 {
2746 *(volatile int*)0x12345678 = 0x12345678;
2747 }
2749 {
2752 }
2753 _SEH2_END;
2754
2755 return (status == STATUS_ACCESS_VIOLATION);
2756}
#define STATUS_ACCESS_VIOLATION
Definition: ntstatus.h:242
void use_lots_of_stack(void)
Definition: pseh.c:2732
Definition: ps.c:97

◆ DEFINE_TEST() [76/104]

DEFINE_TEST ( test_unvolatile  )

Definition at line 2413 of file pseh.c.

2414{
2415 int val = 0;
2416
2417 _SEH2_TRY
2418 {
2419 val = return_one();
2420 *((char*)(intptr_t)0xc0000000) = 0;
2421 }
2423 {
2424 val = val + 3;
2425 }
2426 _SEH2_END;
2427
2428 /* This works with a proper SEH implementation, but not with our hacked PSEH */
2429#ifdef _USE_NATIVE_SEH
2430 return (val == 4);
2431#else
2432 return (val == 4 || val == 3);
2433#endif
2434}

◆ DEFINE_TEST() [77/104]

DEFINE_TEST ( test_unvolatile_2  )

Definition at line 2436 of file pseh.c.

2437{
2438 int val = 0;
2439
2440 _SEH2_TRY
2441 {
2442 val = 1;
2443 *((char*)(intptr_t)0xc0000000) = 0;
2444 val = 2;
2445 }
2447 {
2448 val = val + 3;
2449 }
2450 _SEH2_END;
2451
2452 return (val == 3) || (val == 4) || (val == 5);
2453}

◆ DEFINE_TEST() [78/104]

DEFINE_TEST ( test_unvolatile_3  )

Definition at line 2464 of file pseh.c.

2465{
2466 register int val1 = 0, val2 = 0;
2467
2468 _SEH2_TRY
2469 {
2470 val1 = 1;
2471
2472 _SEH2_TRY
2473 {
2474 val2 = 1;
2475 *((char*)(intptr_t)0xc0000000) = 0;
2476 val2 = 2;
2477 }
2479 {
2480 val2 |= 4;
2481 }
2482 _SEH2_END;
2483
2484 val1 = 2;
2485 *((int*)(intptr_t)0xc0000000) = 1;
2486 val1 = 3;
2487 }
2489 {
2490 val1 = val1 * val2;
2491 }
2492 _SEH2_END;
2493
2494 /* The expected case */
2495 if ((val1 == 10) && (val2 == 5))
2496 return TRUE;
2497
2498 /* The compiler can optimize away "val1 = 1" and "val1 = 2" and
2499 only use the last "val1 = 3", in this case val1 is still 0
2500 when the outer exception handler kicks in */
2501 if ((val1 == 0) && (val2 == 5))
2502 return TRUE;
2503
2504 /* Same as above, but this time val2 optimized away */
2505 if (((val1 == 8) && (val2 == 4)) ||
2506 ((val1 == 0) && (val2 == 4)))
2507 return TRUE;
2508
2509 return FALSE;
2510}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117

◆ DEFINE_TEST() [79/104]

DEFINE_TEST ( test_unvolatile_4  )

Definition at line 2513 of file pseh.c.

2514{
2515 unsigned result = 0xdeadbeef;
2516
2517 _SEH2_TRY
2518 {
2519 *(char*)(intptr_t)0x80000000 = 1;
2520 }
2521 _SEH2_EXCEPT(result == 0xdeadbeef)
2522 {
2523 result = 2;
2524 }
2525 _SEH2_END;
2526
2527 result = (result == 0xdeadbeef) ? 0 : result + 1;
2528
2529 return result == 3;
2530}
GLuint64EXT * result
Definition: glext.h:11304

◆ DEFINE_TEST() [80/104]

DEFINE_TEST ( test_xcode_1  )

Definition at line 1976 of file pseh.c.

1977{
1978 static int ret;
1979
1980 ret = return_zero();
1981
1982 _SEH2_TRY
1983 {
1984 RaiseException(0xE00DEAD0, 0, 0, NULL);
1985 ret = return_zero();
1986 }
1988 {
1989 ret = return_arg(ret);
1990 }
1991 _SEH2_END;
1992
1993 return ret == return_positive();
1994}
static int verify_xcode(int code, int xcode, int *ret, int filter)
Definition: pseh.c:1966

◆ DEFINE_TEST() [81/104]

DEFINE_TEST ( test_xcode_2  )

Definition at line 1996 of file pseh.c.

1997{
1998 static int ret;
1999
2000 ret = return_zero();
2001
2002 _SEH2_TRY
2003 {
2004 RaiseException(0xE00DEAD0, 0, 0, NULL);
2005 ret = return_arg(ret);
2006 }
2008 {
2009 ret = return_zero();
2010 }
2011 _SEH2_END;
2012
2013 return ret == return_positive();
2014}

◆ DEFINE_TEST() [82/104]

DEFINE_TEST ( test_xcode_3  )

Definition at line 2016 of file pseh.c.

2017{
2018 static int ret;
2019
2020 ret = return_zero();
2021
2022 _SEH2_TRY
2023 {
2024 _SEH2_TRY
2025 {
2026 RaiseException(0xE00DEAD0, 0, 0, NULL);
2027 ret = return_zero();
2028 }
2030 {
2031 ret = return_zero();
2032 }
2033 _SEH2_END;
2034 }
2036 {
2037 ret = return_arg(ret);
2038 }
2039 _SEH2_END;
2040
2041 return ret == return_positive();
2042}

◆ DEFINE_TEST() [83/104]

DEFINE_TEST ( test_xpointers_1  )

Definition at line 1602 of file pseh.c.

1603{
1604 static int ret;
1605
1606 ret = return_zero();
1607
1608 _SEH2_TRY
1609 {
1610 RaiseException(0xE00DEAD0, 0, 0, NULL);
1611 }
1613 {
1614 ret = return_arg(ret);
1615 }
1616 _SEH2_END;
1617
1618 return ret == return_positive();
1619}
static int verify_xpointers(struct _EXCEPTION_POINTERS *ep, DWORD code, DWORD flags, DWORD argc, const ULONG_PTR *argv, int *ret, int filter)
Definition: pseh.c:1584

◆ DEFINE_TEST() [84/104]

DEFINE_TEST ( test_xpointers_10  )

Definition at line 1782 of file pseh.c.

1783{
1784 static int ret;
1785 static const ULONG_PTR args[] = { 1, 2, 12345 };
1786
1787 ret = return_zero();
1788
1789 _SEH2_TRY
1790 {
1791 RaiseException(0xE00DEAD0, 0, 2, args);
1792 ret = return_arg(ret);
1793 }
1795 {
1796 ret = return_zero();
1797 }
1798 _SEH2_END;
1799
1800 return ret == return_positive();
1801}
Definition: match.c:390
uint32_t ULONG_PTR
Definition: typedefs.h:65

◆ DEFINE_TEST() [85/104]

DEFINE_TEST ( test_xpointers_11  )

Definition at line 1803 of file pseh.c.

1804{
1805 static int ret;
1806 static const ULONG_PTR args[] = { 1, 2, 12345 };
1807
1808 ret = return_zero();
1809
1810 _SEH2_TRY
1811 {
1812 RaiseException(0xE00DEAD0, 0, 3, args);
1813 ret = return_arg(ret);
1814 }
1816 {
1817 ret = return_zero();
1818 }
1819 _SEH2_END;
1820
1821 return ret == return_positive();
1822}

◆ DEFINE_TEST() [86/104]

DEFINE_TEST ( test_xpointers_12  )

Definition at line 1824 of file pseh.c.

1825{
1826 static int ret;
1827
1828 ret = return_zero();
1829
1830 _SEH2_TRY
1831 {
1832 _SEH2_TRY
1833 {
1835 }
1837 {
1838 ret = return_zero();
1839 }
1840 _SEH2_END;
1841 }
1843 {
1844 ret = return_arg(ret);
1845 }
1846 _SEH2_END;
1847
1848 return ret == return_positive();
1849}
#define EXCEPTION_NONCONTINUABLE
Definition: stubs.h:23

◆ DEFINE_TEST() [87/104]

DEFINE_TEST ( test_xpointers_13  )

Definition at line 1851 of file pseh.c.

1852{
1853 static int ret;
1854 static const ULONG_PTR args[] = { 1, 2, 12345 };
1855
1856 ret = return_zero();
1857
1858 _SEH2_TRY
1859 {
1860 _SEH2_TRY
1861 {
1863 }
1865 {
1866 ret = return_zero();
1867 }
1868 _SEH2_END;
1869 }
1871 {
1872 ret = return_arg(ret);
1873 }
1874 _SEH2_END;
1875
1876 return ret == return_positive();
1877}

◆ DEFINE_TEST() [88/104]

DEFINE_TEST ( test_xpointers_14  )

Definition at line 1879 of file pseh.c.

1880{
1881 static int ret;
1882 static const ULONG_PTR args[] = { 1, 2, 12345 };
1883
1884 ret = return_zero();
1885
1886 _SEH2_TRY
1887 {
1888 _SEH2_TRY
1889 {
1891 }
1893 {
1894 ret = return_zero();
1895 }
1896 _SEH2_END;
1897 }
1899 {
1900 ret = return_arg(ret);
1901 }
1902 _SEH2_END;
1903
1904 return ret == return_positive();
1905}

◆ DEFINE_TEST() [89/104]

DEFINE_TEST ( test_xpointers_15  )

Definition at line 1907 of file pseh.c.

1908{
1909 static int ret;
1910 static const ULONG_PTR args[] = { 1, 2, 12345 };
1911
1912 ret = return_zero();
1913
1914 _SEH2_TRY
1915 {
1916 _SEH2_TRY
1917 {
1919 }
1921 {
1922 ret = return_zero();
1923 }
1924 _SEH2_END;
1925 }
1927 {
1928 ret = return_arg(ret);
1929 }
1930 _SEH2_END;
1931
1932 return ret == return_positive();
1933}

◆ DEFINE_TEST() [90/104]

DEFINE_TEST ( test_xpointers_16  )

Definition at line 1935 of file pseh.c.

1936{
1937 static int ret;
1938 static const ULONG_PTR args[] = { 1, 2, 12345 };
1939
1940 ret = return_zero();
1941
1942 _SEH2_TRY
1943 {
1944 _SEH2_TRY
1945 {
1947 }
1949 {
1950 ret = return_zero();
1951 }
1952 _SEH2_END;
1953 }
1955 {
1956 ret = return_arg(ret);
1957 }
1958 _SEH2_END;
1959
1960 return ret == return_positive();
1961}

◆ DEFINE_TEST() [91/104]

DEFINE_TEST ( test_xpointers_2  )

Definition at line 1621 of file pseh.c.

1622{
1623 static int ret;
1624
1625 ret = return_zero();
1626
1627 _SEH2_TRY
1628 {
1630 }
1632 {
1633 ret = return_arg(ret);
1634 }
1635 _SEH2_END;
1636
1637 return ret == return_positive();
1638}

◆ DEFINE_TEST() [92/104]

DEFINE_TEST ( test_xpointers_3  )

Definition at line 1640 of file pseh.c.

1641{
1642 static int ret;
1643 static const ULONG_PTR args[] = { 1, 2, 12345 };
1644
1645 ret = return_zero();
1646
1647 _SEH2_TRY
1648 {
1650 }
1652 {
1653 ret = return_arg(ret);
1654 }
1655 _SEH2_END;
1656
1657 return ret == return_positive();
1658}

◆ DEFINE_TEST() [93/104]

DEFINE_TEST ( test_xpointers_4  )

Definition at line 1660 of file pseh.c.

1661{
1662 static int ret;
1663 static const ULONG_PTR args[] = { 1, 2, 12345 };
1664
1665 ret = return_zero();
1666
1667 _SEH2_TRY
1668 {
1670 }
1672 {
1673 ret = return_arg(ret);
1674 }
1675 _SEH2_END;
1676
1677 return ret == return_positive();
1678}

◆ DEFINE_TEST() [94/104]

DEFINE_TEST ( test_xpointers_5  )

Definition at line 1680 of file pseh.c.

1681{
1682 static int ret;
1683 static const ULONG_PTR args[] = { 1, 2, 12345 };
1684
1685 ret = return_zero();
1686
1687 _SEH2_TRY
1688 {
1690 }
1692 {
1693 ret = return_arg(ret);
1694 }
1695 _SEH2_END;
1696
1697 return ret == return_positive();
1698}

◆ DEFINE_TEST() [95/104]

DEFINE_TEST ( test_xpointers_6  )

Definition at line 1700 of file pseh.c.

1701{
1702 static int ret;
1703 static const ULONG_PTR args[] = { 1, 2, 12345 };
1704
1705 ret = return_zero();
1706
1707 _SEH2_TRY
1708 {
1710 }
1712 {
1713 ret = return_arg(ret);
1714 }
1715 _SEH2_END;
1716
1717 return ret == return_positive();
1718}

◆ DEFINE_TEST() [96/104]

DEFINE_TEST ( test_xpointers_7  )

Definition at line 1720 of file pseh.c.

1721{
1722 static int ret;
1723
1724 ret = return_zero();
1725
1726 _SEH2_TRY
1727 {
1728 RaiseException(0xE00DEAD0, 0, 0, NULL);
1729 ret = return_arg(ret);
1730 }
1732 {
1733 ret = return_zero();
1734 }
1735 _SEH2_END;
1736
1737 return ret == return_positive();
1738}

◆ DEFINE_TEST() [97/104]

DEFINE_TEST ( test_xpointers_8  )

Definition at line 1740 of file pseh.c.

1741{
1742 static int ret;
1743 static const ULONG_PTR args[] = { 1, 2, 12345 };
1744
1745 ret = return_zero();
1746
1747 _SEH2_TRY
1748 {
1749 RaiseException(0xE00DEAD0, 0, 0, args);
1750 ret = return_arg(ret);
1751 }
1753 {
1754 ret = return_zero();
1755 }
1756 _SEH2_END;
1757
1758 return ret == return_positive();
1759}

◆ DEFINE_TEST() [98/104]

DEFINE_TEST ( test_xpointers_9  )

Definition at line 1761 of file pseh.c.

1762{
1763 static int ret;
1764 static const ULONG_PTR args[] = { 1, 2, 12345 };
1765
1766 ret = return_zero();
1767
1768 _SEH2_TRY
1769 {
1770 RaiseException(0xE00DEAD0, 0, 1, args);
1771 ret = return_arg(ret);
1772 }
1774 {
1775 ret = return_zero();
1776 }
1777 _SEH2_END;
1778
1779 return ret == return_positive();
1780}

◆ DEFINE_TEST() [99/104]

DEFINE_TEST ( test_yield_1  )

Definition at line 957 of file pseh.c.

958{
960}
static int test_yield_1_helper(void)
Definition: pseh.c:942

◆ DEFINE_TEST() [100/104]

DEFINE_TEST ( test_yield_2  )

Definition at line 979 of file pseh.c.

980{
982}
static int test_yield_2_helper(void)
Definition: pseh.c:963

◆ DEFINE_TEST() [101/104]

DEFINE_TEST ( test_yield_3  )

Definition at line 1010 of file pseh.c.

1011{
1013}
static int test_yield_3_helper(void)
Definition: pseh.c:985

◆ DEFINE_TEST() [102/104]

DEFINE_TEST ( test_yield_4  )

Definition at line 1042 of file pseh.c.

1043{
1045}
static int test_yield_4_helper(void)
Definition: pseh.c:1016

◆ DEFINE_TEST() [103/104]

DEFINE_TEST ( test_yield_5  )

Definition at line 1067 of file pseh.c.

1068{
1070}
static int test_yield_5_ret
Definition: pseh.c:1047
static int test_yield_5_helper(void)
Definition: pseh.c:1050

◆ DEFINE_TEST() [104/104]

DEFINE_TEST ( test_yield_6  )

Definition at line 1100 of file pseh.c.

1101{
1103}
static int test_yield_6_helper(void)
Definition: pseh.c:1075
static int test_yield_6_ret
Definition: pseh.c:1072

◆ no_op()

void no_op ( void  )

Definition at line 30 of file psehtest2.c.

31{
32}

◆ passthrough_handler()

static int passthrough_handler ( struct _EXCEPTION_RECORD e,
void f,
struct _CONTEXT c,
void d 
)
static

Definition at line 2639 of file pseh.c.

2640{
2642}
@ ExceptionContinueSearch
Definition: compat.h:91

Referenced by call_test().

◆ return_arg()

int return_arg ( int  arg)

Definition at line 24 of file psehtest2.c.

25{
26 return arg;
27}
void * arg
Definition: msvc.h:10

Referenced by DEFINE_TEST(), test_bug_4004_helper_1(), test_finally_14_helper(), test_finally_4_helper(), and test_finally_9_helper().

◆ return_minusone()

int return_minusone ( void  )

Definition at line 59 of file psehtest2.c.

60{
61 return -1;
62}

Referenced by DEFINE_TEST().

◆ return_minusone_2()

int return_minusone_2 ( void p)

Definition at line 89 of file psehtest2.c.

90{
91 return -1;
92}

Referenced by DEFINE_TEST().

◆ return_minusone_3()

int return_minusone_3 ( int  n)

Definition at line 119 of file psehtest2.c.

120{
121 return -1;
122}

Referenced by DEFINE_TEST().

◆ return_minusone_4()

int return_minusone_4 ( void p,
int  n 
)

Definition at line 149 of file psehtest2.c.

150{
151 return -1;
152}

Referenced by DEFINE_TEST().

◆ return_negative()

int return_negative ( void  )

Definition at line 47 of file psehtest2.c.

48{
49 return -1234;
50}

Referenced by DEFINE_TEST().

◆ return_negative_2()

int return_negative_2 ( void p)

Definition at line 77 of file psehtest2.c.

78{
79 return -1234;
80}

Referenced by DEFINE_TEST().

◆ return_negative_3()

int return_negative_3 ( int  n)

Definition at line 107 of file psehtest2.c.

108{
109 return -1234;
110}

Referenced by DEFINE_TEST().

◆ return_negative_4()

int return_negative_4 ( void p,
int  n 
)

Definition at line 137 of file psehtest2.c.

138{
139 return -1234;
140}

Referenced by DEFINE_TEST().

◆ return_one()

int return_one ( void  )

Definition at line 53 of file psehtest2.c.

54{
55 return 1;
56}

Referenced by DEFINE_TEST(), test_finally_13_helper(), test_finally_14_helper(), test_finally_9_helper(), and test_yield_6_helper().

◆ return_one_2()

int return_one_2 ( void p)

Definition at line 83 of file psehtest2.c.

84{
85 return 1;
86}

Referenced by DEFINE_TEST().

◆ return_one_3()

int return_one_3 ( int  n)

Definition at line 113 of file psehtest2.c.

114{
115 return 1;
116}

Referenced by DEFINE_TEST().

◆ return_one_4()

int return_one_4 ( void p,
int  n 
)

Definition at line 143 of file psehtest2.c.

144{
145 return 1;
146}

Referenced by DEFINE_TEST().

◆ return_positive()

◆ return_positive_2()

int return_positive_2 ( void p)

Definition at line 71 of file psehtest2.c.

72{
73 return 1234;
74}

Referenced by DEFINE_TEST().

◆ return_positive_3()

int return_positive_3 ( int  n)

Definition at line 101 of file psehtest2.c.

102{
103 return 1234;
104}

Referenced by DEFINE_TEST().

◆ return_positive_4()

int return_positive_4 ( void p,
int  n 
)

Definition at line 131 of file psehtest2.c.

132{
133 return 1234;
134}

Referenced by DEFINE_TEST().

◆ return_zero()

◆ return_zero_2()

int return_zero_2 ( void p)

Definition at line 65 of file psehtest2.c.

66{
67 return 0;
68}

Referenced by DEFINE_TEST().

◆ return_zero_3()

int return_zero_3 ( int  n)

Definition at line 95 of file psehtest2.c.

96{
97 return 0;
98}

Referenced by DEFINE_TEST().

◆ return_zero_4()

int return_zero_4 ( void p,
int  n 
)

Definition at line 125 of file psehtest2.c.

126{
127 return 0;
128}

Referenced by DEFINE_TEST().

◆ sanity_check()

static DECLSPEC_NOINLINE int sanity_check ( int  ret,
struct volatile_context before,
struct volatile_context after 
)
static

Definition at line 2626 of file pseh.c.

2627{
2628 if(ret && memcmp(before, after, sizeof(*before)))
2629 {
2630 trace("volatile context corrupted\n");
2631 return 0;
2632 }
2633
2634 return ret;
2635}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112

Referenced by call_test().

◆ set_positive()

void set_positive ( int p)

Definition at line 155 of file psehtest2.c.

156{
157 *p = 1234;
158}
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by DEFINE_TEST().

◆ START_TEST()

START_TEST ( pseh  )

Definition at line 2768 of file pseh.c.

2769{
2770 const struct subtest testsuite[] =
2771 {
2772 USE_TEST(test_empty_1),
2773 USE_TEST(test_empty_2),
2774 USE_TEST(test_empty_3),
2775 USE_TEST(test_empty_4),
2776 USE_TEST(test_empty_5),
2777 USE_TEST(test_empty_6),
2778 USE_TEST(test_empty_7),
2779 USE_TEST(test_empty_8),
2780
2781 USE_TEST(test_execute_handler_1),
2782 USE_TEST(test_continue_execution_1),
2783 USE_TEST(test_continue_search_1),
2784 USE_TEST(test_execute_handler_2),
2785 USE_TEST(test_continue_execution_2),
2786
2787 USE_TEST(test_execute_handler_3),
2788 USE_TEST(test_continue_execution_3),
2789 USE_TEST(test_continue_search_2),
2790 USE_TEST(test_execute_handler_4),
2791 USE_TEST(test_continue_execution_4),
2792
2793 USE_TEST(test_execute_handler_5),
2794 USE_TEST(test_continue_execution_5),
2795 USE_TEST(test_continue_search_3),
2796 USE_TEST(test_execute_handler_6),
2797 USE_TEST(test_continue_execution_6),
2798
2799 USE_TEST(test_execute_handler_7),
2800 USE_TEST(test_continue_execution_7),
2801 USE_TEST(test_continue_search_4),
2802 USE_TEST(test_execute_handler_8),
2803 USE_TEST(test_continue_execution_8),
2804
2805 USE_TEST(test_execute_handler_9),
2806 USE_TEST(test_continue_execution_9),
2807 USE_TEST(test_continue_search_5),
2808 USE_TEST(test_execute_handler_10),
2809 USE_TEST(test_continue_execution_10),
2810
2811 USE_TEST(test_execute_handler_11),
2812 USE_TEST(test_continue_execution_11),
2813 USE_TEST(test_continue_search_6),
2814 USE_TEST(test_execute_handler_12),
2815 USE_TEST(test_continue_execution_12),
2816
2817 USE_TEST(test_leave_1),
2818 USE_TEST(test_leave_2),
2819 USE_TEST(test_leave_3),
2820 USE_TEST(test_leave_4),
2821 USE_TEST(test_leave_5),
2822 USE_TEST(test_leave_6),
2823
2824 USE_TEST(test_yield_1),
2825 USE_TEST(test_yield_2),
2826 USE_TEST(test_yield_3),
2827 USE_TEST(test_yield_4),
2828 USE_TEST(test_yield_5),
2829 USE_TEST(test_yield_6),
2830
2831 USE_TEST(test_finally_1),
2832 USE_TEST(test_finally_2),
2833 USE_TEST(test_finally_3),
2834 USE_TEST(test_finally_4),
2835 USE_TEST(test_finally_5),
2836 USE_TEST(test_finally_6),
2837 USE_TEST(test_finally_7),
2838 USE_TEST(test_finally_8),
2839 USE_TEST(test_finally_9),
2840 USE_TEST(test_finally_10),
2841 USE_TEST(test_finally_11),
2842 USE_TEST(test_finally_12),
2843 USE_TEST(test_finally_13),
2844 USE_TEST(test_finally_14),
2845
2846 USE_TEST(test_xpointers_1),
2847 USE_TEST(test_xpointers_2),
2848 USE_TEST(test_xpointers_3),
2849 USE_TEST(test_xpointers_4),
2850 USE_TEST(test_xpointers_5),
2851 USE_TEST(test_xpointers_6),
2852 USE_TEST(test_xpointers_7),
2853 USE_TEST(test_xpointers_8),
2854 USE_TEST(test_xpointers_9),
2855 USE_TEST(test_xpointers_10),
2856 USE_TEST(test_xpointers_11),
2857 USE_TEST(test_xpointers_12),
2858 USE_TEST(test_xpointers_13),
2859 USE_TEST(test_xpointers_14),
2860 USE_TEST(test_xpointers_15),
2861 USE_TEST(test_xpointers_16),
2862
2863 USE_TEST(test_xcode_1),
2864 USE_TEST(test_xcode_2),
2865 USE_TEST(test_xcode_3),
2866
2867 USE_TEST(test_abnorm_1),
2868 USE_TEST(test_abnorm_2),
2869 USE_TEST(test_abnorm_3),
2870 USE_TEST(test_abnorm_4),
2871 USE_TEST(test_abnorm_5),
2872 USE_TEST(test_abnorm_6),
2873 USE_TEST(test_abnorm_7),
2874 USE_TEST(test_abnorm_8),
2875
2876 USE_TEST(test_nested_locals_1),
2877 USE_TEST(test_nested_locals_2),
2878 USE_TEST(test_nested_locals_3),
2879
2880 USE_TEST(test_bug_4004),
2881 USE_TEST(test_bug_4663),
2882
2883 USE_TEST(test_unvolatile),
2884 USE_TEST(test_unvolatile_2),
2885#ifndef __cplusplus
2886 USE_TEST(test_unvolatile_3),
2887#endif
2888 USE_TEST(test_unvolatile_4),
2889 USE_TEST(test_finally_goto),
2890 USE_TEST(test_nested_exception),
2891 USE_TEST(test_PSEH3_bug),
2892 USE_TEST(test_PSEH3_bug2),
2893 };
2894
2895 size_t i;
2896
2897 for(i = 0; i < sizeof(testsuite) / sizeof(testsuite[0]); ++ i)
2898 ok(call_test(testsuite[i].func), "%s failed\n", testsuite[i].name);
2899}
#define ok(value,...)
Definition: atltest.h:57
static DECLSPEC_NOINLINE int call_test(int(*func)(void))
Definition: pseh.c:2647
#define USE_TEST(NAME_)
Definition: pseh.c:2760
Definition: pseh.c:2763
const char * name
Definition: pseh.c:2764

◆ test_bug_4004_helper_1()

static void test_bug_4004_helper_1 ( void  )
static

Definition at line 2327 of file pseh.c.

2328{
2329 int i1, i2, i3;
2330
2331 i1 = return_positive();
2332 i2 = return_positive();
2333 i3 = return_positive();
2334 (void)return_arg(i1 + i2 + i3);
2335
2336 _SEH2_TRY
2337 {
2338 RaiseException(0xE00DEAD0, 0, 0, NULL);
2339 }
2341 {
2342 }
2343 _SEH2_END;
2344}

Referenced by test_bug_4004_helper_2().

◆ test_bug_4004_helper_2()

static void test_bug_4004_helper_2 ( void  )
static

Definition at line 2347 of file pseh.c.

2348{
2349 _SEH2_TRY
2350 {
2352 }
2354 {
2355 }
2356 _SEH2_END;
2357}
static void test_bug_4004_helper_1(void)
Definition: pseh.c:2327

Referenced by DEFINE_TEST().

◆ test_finally_13_helper()

static void test_finally_13_helper ( void  )
static

Definition at line 1463 of file pseh.c.

1464{
1466
1467 _SEH2_TRY
1468 {
1469 _SEH2_TRY
1470 {
1472 _SEH2_YIELD(return);
1474 }
1476 {
1479 }
1480 _SEH2_END;
1481 }
1483 {
1486
1487 RaiseException(0xE00DEAD0, 0, 0, NULL);
1489 }
1490 _SEH2_END;
1491
1493}

Referenced by DEFINE_TEST().

◆ test_finally_14_helper()

static void test_finally_14_helper ( void  )
static

Definition at line 1519 of file pseh.c.

1520{
1522
1523 _SEH2_TRY
1524 {
1525 _SEH2_TRY
1526 {
1527 _SEH2_TRY
1528 {
1530 RaiseException(0xE00DEAD0, 0, 0, NULL);
1532 }
1534 {
1537 }
1538 _SEH2_END;
1539 }
1541 {
1544
1545 RaiseException(0xE00DEAD0, 0, 0, NULL);
1547 }
1548 _SEH2_END;
1549 }
1551 {
1554 }
1555 _SEH2_END;
1556
1558}

Referenced by DEFINE_TEST().

◆ test_finally_4_helper()

static int test_finally_4_helper ( void  )
static

Definition at line 1169 of file pseh.c.

1170{
1172
1173 _SEH2_TRY
1174 {
1176 _SEH2_YIELD(return return_positive());
1177 }
1179 {
1181 }
1182 _SEH2_END;
1183
1184 return return_zero();
1185}

Referenced by DEFINE_TEST().

◆ test_finally_9_helper()

static int test_finally_9_helper ( void  )
static

Definition at line 1312 of file pseh.c.

1313{
1315
1316 _SEH2_TRY
1317 {
1318 _SEH2_TRY
1319 {
1321 _SEH2_YIELD(return return_positive());
1322 }
1324 {
1327 }
1328 _SEH2_END;
1329 }
1331 {
1334 }
1335 _SEH2_END;
1336
1337 return return_zero();
1338}

Referenced by DEFINE_TEST().

◆ test_yield_1_helper()

static int test_yield_1_helper ( void  )
static

Definition at line 942 of file pseh.c.

943{
945 {
947 }
949 {
950 _SEH2_YIELD(return return_zero());
951 }
952 _SEH2_END;
953
954 return return_zero();
955}

Referenced by DEFINE_TEST().

◆ test_yield_2_helper()

static int test_yield_2_helper ( void  )
static

Definition at line 963 of file pseh.c.

964{
966 {
967 RaiseException(0xE00DEAD0, 0, 0, NULL);
968 _SEH2_YIELD(return return_zero());
969 }
971 {
973 }
974 _SEH2_END;
975
976 return return_zero();
977}

Referenced by DEFINE_TEST().

◆ test_yield_3_helper()

static int test_yield_3_helper ( void  )
static

Definition at line 985 of file pseh.c.

986{
988 {
990 {
992 }
994 {
995 _SEH2_YIELD(return return_zero());
996 }
997 _SEH2_END;
998
999 _SEH2_YIELD(return return_zero());
1000 }
1002 {
1003 _SEH2_YIELD(return return_zero());
1004 }
1005 _SEH2_END;
1006
1007 return return_zero();
1008}

Referenced by DEFINE_TEST().

◆ test_yield_4_helper()

static int test_yield_4_helper ( void  )
static

Definition at line 1016 of file pseh.c.

1017{
1018 _SEH2_TRY
1019 {
1020 _SEH2_TRY
1021 {
1022 RaiseException(0xE00DEAD0, 0, 0, NULL);
1023 _SEH2_YIELD(return return_zero());
1024 }
1026 {
1027 _SEH2_YIELD(return return_positive());
1028 }
1029 _SEH2_END;
1030
1031 _SEH2_YIELD(return return_zero());
1032 }
1034 {
1035 _SEH2_YIELD(return return_zero());
1036 }
1037 _SEH2_END;
1038
1039 return return_zero();
1040}

Referenced by DEFINE_TEST().

◆ test_yield_5_helper()

static int test_yield_5_helper ( void  )
static

Definition at line 1050 of file pseh.c.

1051{
1053
1054 _SEH2_TRY
1055 {
1056 _SEH2_YIELD(return return_positive());
1057 }
1059 {
1061 }
1062 _SEH2_END;
1063
1064 return return_zero();
1065}

Referenced by DEFINE_TEST().

◆ test_yield_6_helper()

static int test_yield_6_helper ( void  )
static

Definition at line 1075 of file pseh.c.

1076{
1078
1079 _SEH2_TRY
1080 {
1081 _SEH2_TRY
1082 {
1083 _SEH2_YIELD(return return_positive());
1084 }
1086 {
1088 }
1089 _SEH2_END;
1090 }
1092 {
1094 }
1095 _SEH2_END;
1096
1097 return return_zero();
1098}

Referenced by DEFINE_TEST().

◆ unhandled_exception()

static LONG WINAPI unhandled_exception ( PEXCEPTION_POINTERS  ExceptionInfo)
static

Definition at line 2602 of file pseh.c.

2603{
2604 trace("unhandled exception %08lX thrown from %p\n", ExceptionInfo->ExceptionRecord->ExceptionCode, ExceptionInfo->ExceptionRecord->ExceptionAddress);
2606}
PEXCEPTION_RECORD ExceptionRecord
Definition: rtltypes.h:200
DWORD ExceptionCode
Definition: compat.h:208
PVOID ExceptionAddress
Definition: compat.h:211

Referenced by call_test().

◆ use_lots_of_stack()

void use_lots_of_stack ( void  )

Definition at line 2732 of file pseh.c.

2733{
2734 int i;
2735 volatile int arr[512];
2736 for (i = 0; i < 512; i++)
2737 arr[i] = 123;
2738 (void)arr;
2739}

Referenced by DEFINE_TEST().

◆ verify_xcode()

static int verify_xcode ( int  code,
int  xcode,
int ret,
int  filter 
)
static

Definition at line 1966 of file pseh.c.

1967{
1968 *ret = code == xcode;
1969
1970 if(*ret)
1971 *ret = return_positive();
1972
1973 return filter;
1974}
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glext.h:7005
Definition: inflate.c:139

Referenced by DEFINE_TEST().

◆ verify_xpointers()

static int verify_xpointers ( struct _EXCEPTION_POINTERS ep,
DWORD  code,
DWORD  flags,
DWORD  argc,
const ULONG_PTR argv,
int ret,
int  filter 
)
static

Definition at line 1584 of file pseh.c.

1585{
1586 *ret =
1587 ep &&
1588 ep->ExceptionRecord &&
1589 ep->ContextRecord &&
1593 (argv || !argc) &&
1594 memcmp(ep->ExceptionRecord->ExceptionInformation, argv, sizeof(argv[0]) * argc) == 0;
1595
1596 if(*ret)
1597 *ret = return_positive();
1598
1599 return filter;
1600}
static int argc
Definition: ServiceArgs.c:12
GLbitfield flags
Definition: glext.h:7161
#define argv
Definition: mplay32.c:18
PCONTEXT ContextRecord
Definition: rtltypes.h:201
DWORD NumberParameters
Definition: compat.h:212
DWORD ExceptionFlags
Definition: compat.h:209
ULONG_PTR ExceptionInformation[EXCEPTION_MAXIMUM_PARAMETERS]
Definition: compat.h:213

Referenced by DEFINE_TEST().

Variable Documentation

◆ test_finally_13_ret

int test_finally_13_ret
static

Definition at line 1460 of file pseh.c.

Referenced by DEFINE_TEST(), and test_finally_13_helper().

◆ test_finally_14_ret

int test_finally_14_ret
static

Definition at line 1516 of file pseh.c.

Referenced by DEFINE_TEST(), and test_finally_14_helper().

◆ test_finally_4_ret

int test_finally_4_ret
static

Definition at line 1167 of file pseh.c.

Referenced by DEFINE_TEST(), and test_finally_4_helper().

◆ test_finally_9_ret

int test_finally_9_ret
static

Definition at line 1310 of file pseh.c.

Referenced by DEFINE_TEST(), and test_finally_9_helper().

◆ test_yield_5_ret

int test_yield_5_ret
static

Definition at line 1047 of file pseh.c.

Referenced by DEFINE_TEST(), and test_yield_5_helper().

◆ test_yield_6_ret

int test_yield_6_ret
static

Definition at line 1072 of file pseh.c.

Referenced by DEFINE_TEST(), and test_yield_6_helper().