swar-c99-6.7.8-initial.c 1.28 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.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;
}