Skip to content

Commit 096af3c

Browse files
committed
CPP: Add test cases involving __builtin_complex.
1 parent 7127624 commit 096af3c

File tree

1 file changed

+16
-0
lines changed
  • cpp/ql/test/query-tests/jsf/4.13 Functions/AV Rule 114

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
/*_Complex double complexTest1(float a, float b) {
3+
_Complex double x = __builtin_complex(a, b); // BAD [EXTRACTOR ERROR]
4+
}
5+
6+
_Complex double complexTest2(float a, float b) {
7+
auto x = __builtin_complex(a, b) * 2.0f; // BAD [EXTRACTOR ERROR]
8+
}
9+
10+
_Complex double complexTest3(float a, float b) {
11+
return __builtin_complex(a, b); // GOOD [EXTRACTOR ERROR]
12+
}
13+
14+
auto complexTest4(float a, float b) {
15+
return __builtin_complex(a, b) * 2.0f; // GOOD [EXTRACTOR ERROR]
16+
}*/

0 commit comments

Comments
 (0)