Skip to content

Commit 51d4106

Browse files
mishok2503ladisgin
authored andcommitted
add asm-tests
1 parent 98cf1ad commit 51d4106

File tree

2 files changed

+43
-1
lines changed

2 files changed

+43
-1
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
int very_easy(int x) {
2+
asm(" ");
3+
return 3 * x;
4+
}
5+
6+
int asm_example(int a) {
7+
if (a == 42) {
8+
return -1;
9+
}
10+
asm("addl $5, %0" : "+r"(a));
11+
return a;
12+
}
13+
14+
int jmp_asm(int a) {
15+
asm volatile ("mov $0x10, %%eax\n\t"
16+
"sub %%eax, %0\n\t"
17+
"cmp $4, %0\n\t"
18+
"jle end\n\t"
19+
"add $0300, %0\n\t"
20+
"end:\n\t"
21+
: "+r"(a)
22+
:: "eax");
23+
return a;
24+
}
25+
26+
float float_avx(float a, float b) {
27+
if (a == 239) {
28+
float data[4] = {a, b, 1, 9};
29+
float res;
30+
31+
asm("movups %0, %%xmm0\n\t"
32+
"haddps %%xmm0, %%xmm0\n\t"
33+
"haddps %%xmm0, %%xmm0\n\t"
34+
"movss %%xmm0, %1\n\t"
35+
: "=m"(data)
36+
: "m"(res)
37+
: "xmm0");
38+
39+
return res;
40+
}
41+
return 42;
42+
}

server/test/framework/Server_Tests.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1369,7 +1369,7 @@ namespace {
13691369
Status status = Server::TestsGenServiceImpl::ProcessBaseTestRequest(testGen, writer.get());
13701370
ASSERT_TRUE(status.ok()) << status.error_message();
13711371

1372-
EXPECT_EQ(0, testUtils::getNumberOfTests(testGen.tests));
1372+
testUtils::checkMinNumberOfTests(testGen.tests, 1);
13731373
}
13741374

13751375
TEST_F(Server_Test, Memory_Test) {

0 commit comments

Comments
 (0)