Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cc016d5

Browse files
author
Matthew Gretton-Dann
committed
C++: Add further vector_size attribute tests
1 parent c10ed5e commit cc016d5

3 files changed

Lines changed: 13 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// semmle-extractor-options: --clang
2+
void builtin(void) {
3+
__attribute__((vector_size(16U))) int vec2 = { 0, 1, 2, 3 };
4+
__attribute__((vector_size(16UL))) int vec = { 0, 1, 2, 3 };
5+
__builtin_shufflevector(vec, vec, 3, 2, 1, 0);
6+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
| file://:0:0:0:0 | __attribute((vector_size(16))) int | 4 |
2+
| file://:0:0:0:0 | __attribute((vector_size(16U))) int | 4 |
3+
| file://:0:0:0:0 | __attribute((vector_size(16UL))) int | 4 |
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import cpp
2+
3+
from GNUVectorType gvt
4+
select gvt, gvt.getNumElements()

0 commit comments

Comments
 (0)