mirror of
https://github.com/github/codeql.git
synced 2026-05-05 05:35:13 +02:00
C++: add a test for __builtin_complex
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
| complex.c:3:23:3:51 | __builtin_complex | file://:0:0:0:0 | _Complex double | complex.c:3:41:3:44 | real | file://:0:0:0:0 | double | complex.c:3:47:3:50 | imag | file://:0:0:0:0 | double |
|
||||
| complex.c:4:23:4:57 | __builtin_complex | file://:0:0:0:0 | _Complex double | complex.c:4:41:4:47 | 2.71828000000000003 | file://:0:0:0:0 | double | complex.c:4:50:4:56 | 3.141589999999999883 | file://:0:0:0:0 | double |
|
||||
| complex.c:8:22:8:52 | __builtin_complex | file://:0:0:0:0 | _Complex float | complex.c:8:40:8:44 | realf | file://:0:0:0:0 | float | complex.c:8:47:8:51 | imagf | file://:0:0:0:0 | float |
|
||||
| complex.c:9:22:9:52 | __builtin_complex | file://:0:0:0:0 | _Complex float | complex.c:9:40:9:44 | 1.230000019 | file://:0:0:0:0 | float | complex.c:9:47:9:51 | 4.559999943 | file://:0:0:0:0 | float |
|
||||
7
cpp/ql/test/library-tests/builtins/complex/builtin.ql
Normal file
7
cpp/ql/test/library-tests/builtins/complex/builtin.ql
Normal file
@@ -0,0 +1,7 @@
|
||||
import cpp
|
||||
|
||||
from BuiltInComplexOperation bico, Expr real, Expr imag
|
||||
where
|
||||
real = bico.getRealOperand() and
|
||||
imag = bico.getImaginaryOperand()
|
||||
select bico, bico.getType(), real, real.getType(), imag, imag.getType()
|
||||
10
cpp/ql/test/library-tests/builtins/complex/complex.c
Normal file
10
cpp/ql/test/library-tests/builtins/complex/complex.c
Normal file
@@ -0,0 +1,10 @@
|
||||
|
||||
void builtin_double(double real, double imag) {
|
||||
_Complex double a = __builtin_complex(real, imag);
|
||||
_Complex double b = __builtin_complex(2.71828, 3.14159);
|
||||
}
|
||||
|
||||
void builtin_float(float realf, float imagf) {
|
||||
_Complex float c = __builtin_complex(realf, imagf);
|
||||
_Complex float d = __builtin_complex(1.23f, 4.56f);
|
||||
}
|
||||
Reference in New Issue
Block a user