Skip to content

Commit e89f8c2

Browse files
committed
C++: add test for calling conventions
1 parent acf6f38 commit e89f8c2

File tree

3 files changed

+23
-3
lines changed

3 files changed

+23
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
| test.cpp:4:21:4:35 | definition of thiscall_method | thiscall |
2+
| test.cpp:7:13:7:25 | definition of func_overload | cdecl |
3+
| test.cpp:8:15:8:27 | definition of func_overload | stdcall |
4+
| test.cpp:10:17:10:30 | declaration of func_prototype | fastcall |
5+
| test.cpp:12:6:12:19 | definition of func_prototype | fastcall |
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import cpp
22

3-
from FunctionDeclarationEntry func, CallingConventionSpecifier ccs
4-
where ccs.hasName(func.getASpecifier())
5-
select func, func.getASpecifier()
3+
from FunctionDeclarationEntry f
4+
select f, f.getASpecifier().(CallingConventionSpecifier)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// semmle-extractor-options: --microsoft
2+
3+
struct call_conventions {
4+
void __thiscall thiscall_method() {}
5+
};
6+
7+
void __cdecl func_cdecl() {}
8+
9+
void __stdcall func_stdcall() {}
10+
11+
void __fastcall func_fastcall() {}
12+
13+
void __vectorcall func_vectorcall() {}
14+
15+
int __cdecl func_overload() {}
16+
int __stdcall func_overload(int x) {}

0 commit comments

Comments
 (0)