File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -61,3 +61,26 @@ void test_setjmp2(void *env) {
61
61
// OGCG: call i32 @_setjmp(ptr noundef [[ENV]])
62
62
_setjmp (env );
63
63
}
64
+
65
+ void test_longjmp (void * env ) {
66
+ // CIR-LABEL: test_longjmp
67
+ // CIR-SAME: [[ENV:%.*]]:
68
+ // CIR-NEXT: [[ENV_ALLOCA:%[0-9]+]] = cir.alloca !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>,
69
+ // CIR-NEXT: cir.store [[ENV]], [[ENV_ALLOCA]] : !cir.ptr<!void>, !cir.ptr<!cir.ptr<!void>>
70
+ // CIR-NEXT: [[ENV_LOAD:%[0-9]+]] = cir.load align(8) [[ENV_ALLOCA]]
71
+ // CIR-NEXT: [[CAST:%[0-9]+]] = cir.cast(bitcast, [[ENV_LOAD]] : !cir.ptr<!void>), !cir.ptr<!cir.ptr<!void>>
72
+ // CIR-NEXT: cir.eh.longjmp [[CAST]] : (!cir.ptr<!cir.ptr<!void>>) -> ()
73
+ // CIR-NEXT: cir.unreachable
74
+
75
+
76
+ // LLVM-LABEL: test_longjmp
77
+ // LLVM-SAME: (ptr{{.*}}[[ENV:%.*]])
78
+ // LLVM-NEXT: @llvm.eh.sjlj.longjmp(ptr{{.*}}[[ENV]])
79
+ // LLVM-NEXT: unreachable
80
+
81
+ // OGCG-LABEL: test_longjmp
82
+ // OGCG-SAME: (ptr{{.*}}[[ENV:%.*]])
83
+ // OGCG: @llvm.eh.sjlj.longjmp(ptr{{.*}}[[ENV]])
84
+ // OGCG-NEXT: unreachable
85
+ __builtin_longjmp (env , 1 );
86
+ }
You can’t perform that action at this time.
0 commit comments