swar-c99-6.2.5-types.c 1.35 KB
/* -----------------------------------------------------------------------------
 *  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.2.5-types.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"

// variable
unsigned int var32x1u __attribute__((subword(1)));  // the same as subword(1,32)
signed int   var32x1s __attribute__((subword(1)));

// directly declared array are not allowed
//unsigned int array10x32x1u __attribute__((subword(1)))[10];
//signed int   array10x32x1s __attribute__((subword(1))) [10];

typedef unsigned int swar32x1u_t __attribute__((subword(1)));
swar32x1u_t array10x32x1u[10];

int main(void)
{
  unsigned int locvar16x2u __attribute__((subword(2)));
  signed int   locvar16x2s __attribute__((subword(2)));
  
  return 0;
}