mirror of
https://github.com/github/codeql.git
synced 2025-12-17 01:03:14 +01:00
C++: Add further vector_size attribute tests
This commit is contained in:
6
cpp/ql/test/library-tests/vector_sizes/code.c
Normal file
6
cpp/ql/test/library-tests/vector_sizes/code.c
Normal file
@@ -0,0 +1,6 @@
|
||||
// semmle-extractor-options: --clang
|
||||
void builtin(void) {
|
||||
__attribute__((vector_size(16U))) int vec2 = { 0, 1, 2, 3 };
|
||||
__attribute__((vector_size(16UL))) int vec = { 0, 1, 2, 3 };
|
||||
__builtin_shufflevector(vec, vec, 3, 2, 1, 0);
|
||||
}
|
||||
3
cpp/ql/test/library-tests/vector_sizes/test.expected
Normal file
3
cpp/ql/test/library-tests/vector_sizes/test.expected
Normal file
@@ -0,0 +1,3 @@
|
||||
| file://:0:0:0:0 | __attribute((vector_size(16))) int | 4 |
|
||||
| file://:0:0:0:0 | __attribute((vector_size(16U))) int | 4 |
|
||||
| file://:0:0:0:0 | __attribute((vector_size(16UL))) int | 4 |
|
||||
4
cpp/ql/test/library-tests/vector_sizes/test.ql
Normal file
4
cpp/ql/test/library-tests/vector_sizes/test.ql
Normal file
@@ -0,0 +1,4 @@
|
||||
import cpp
|
||||
|
||||
from GNUVectorType gvt
|
||||
select gvt, gvt.getNumElements()
|
||||
Reference in New Issue
Block a user