Skip to content

Commit 395bb4e

Browse files
Integrate test cases from #161
1 parent 00120f7 commit 395bb4e

File tree

8 files changed

+47
-1
lines changed

8 files changed

+47
-1
lines changed

test/small1/asm_goto1.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "testharness.h"
2+
3+
int main() {
4+
asm goto ("nop");
5+
E(1);
6+
}

test/small1/asm_goto2.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "testharness.h"
2+
3+
void code() {
4+
asm goto ("nop" : );
5+
E(1);
6+
}

test/small1/asm_goto3.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "testharness.h"
2+
3+
int main(void) {
4+
start:
5+
asm goto ("nop" : : : : start, exit);
6+
exit:
7+
SUCCESS;
8+
}

test/small1/asm_goto4.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#include "testharness.h"
2+
3+
void code() {
4+
start:
5+
asm("nop" : : : : start, exit);
6+
exit:
7+
E(1);
8+
}

test/small1/asm_goto5.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "testharness.h"
2+
3+
void code() {
4+
asm goto ("nop" : : : : start, exit);
5+
E(1);
6+
}

test/small1/asm_goto6.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#include "testharness.h"
2+
3+
void code() {
4+
asm goto ("nop" : : : );
5+
E(1);
6+
}

test/testcil.pl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,13 @@ sub addToGroup {
182182
addTest("test/asm4 _GNUCC=1");
183183
addTest("test/asm_emptyclobberallowed _GNUCC=1");
184184
addTest("testobj/asm5 _GNUCC=1");
185-
addTest("test/asm6");
185+
addTest("test/asm_goto0");
186+
addTestFail("test/asm_goto1", "expected non-empty labels list in asm goto");
187+
addTestFail("test/asm_goto2", "expected non-empty labels list in asm goto");
188+
addTest("test/asm_goto3");
189+
addTestFail("test/asm_goto4", "labels provided in inline asm without goto attribute");
190+
addTestFail("test/asm_goto5", "Error: Label start not found");
191+
addTestFail("test/asm_goto6", "expected non-empty labels list in asm goto");
186192

187193
addTest("testrun/offsetof");
188194
addTest("testrun/offsetof1");

0 commit comments

Comments
 (0)