Skip to content

Commit

Permalink
mod-since-setjmp-test
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Tietz committed Jan 25, 2024
1 parent a1caa65 commit 7030715
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions tests/regression/79-assembly/04-asm-modified-since-setjmp.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#include <setjmp.h>

jmp_buf buf;

int main(void) {
int x;
start:
x = 5;
if (setjmp(buf)) {
//read
asm ("nop" : : "x" (x));
return 0;
} else {
//write
asm goto ("nop" : "=x" (x) : : : exit2, exit); //WARN
longjmp(buf, 1);
}
exit2:
exit: return 0;
}

0 comments on commit 7030715

Please sign in to comment.