swar-c99-6.5.6-add_ops.c 1.06 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.5.6-add_ops.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"

su10x3b a, b, c;
su10x3b pole[17];
ss10x3b s;

int main(void)
{
  pole[0] = a + b;
  c = a + b;
#if 0
  pole = a + pole;
#endif

  pole[0] = a + pole[1];

#if 0  
  s = a + c;
  b = c + s;
#endif

  b = c + ((su10x3b)s);

#if 1
  c = a - b;
#endif
  
  return 0;
}