C++: Add further vector_size attribute tests

This commit is contained in:
Matthew Gretton-Dann
2019-09-23 12:52:19 +01:00
parent c10ed5e114
commit cc016d583d
3 changed files with 13 additions and 0 deletions

View 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);
}

View 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 |

View File

@@ -0,0 +1,4 @@
import cpp
from GNUVectorType gvt
select gvt, gvt.getNumElements()