swar-c99-6.7.8-initial.c
1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* -----------------------------------------------------------------------------
* Copyright (C) 2018-2020 daiteq s.r.o. http://www.daiteq.com
*
* This program is distributed WITHOUT ANY WARRANTY; without even
* the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE.
*
* -----------------------------------------------------------------------------
* Filename : swar-c99-6.7.8-initial.c
* Authors : Roman Bartosinski
* Description : simple test of clang/LLVM compiler with SWAR extension
* Release :
* Version :
* Date :
* -----------------------------------------------------------------------------
*/
//A: --has-swar
//C: -daiteq-swar-enable
#define SWAR_USE_UNSIGNED_TYPES
#define SWAR_USE_SIGNED_TYPES
#include "swar-c99.h"
const su10x3b c10x3u = {1,2,3,4,5,6,7,1,2,3};
int foo(void)
{
volatile su10x3b v3u;
//v3u[0] = 3;
//v3u = 0x12;
//v3u = (const su10x3b){1,2,3,4,5,6,7,0,1,2};
v3u = c10x3u;
//su10x3b a3u[4] = {
//{1,2,3,4,5,6,7,8,9,10},
//{0,1,2,3,4,1,2,3,4},
//{7,7,7,7,7,7,7,7,7},
//};
// su10x3b t3u;
// unsigned int initdata = 0x12345678;
// t3u = *((su10x3b *)&initdata);
return 0;
}
su32x1b var32x1u;
ss32x1b var32x1s;
int main(void)
{
foo();
return 0;
}