diff options
author | arphaman <arphaman@gmail.com> | 2013-09-18 13:35:12 +0100 |
---|---|---|
committer | arphaman <arphaman@gmail.com> | 2013-09-18 13:35:12 +0100 |
commit | 8e83adfdc9dacf83d9bdee65bd23b9416ceededf (patch) | |
tree | 1d85425f68876c179b6f66adcda60c27c5faafe4 /test/Unit/selected_int_kind.cpp | |
parent | a0879b97593067e436bf5c5a3860c3da697a3148 (diff) | |
download | libflangrt-8e83adfdc9dacf83d9bdee65bd23b9416ceededf.tar.gz |
added support for selected_int_kind intrinsic
Diffstat (limited to 'test/Unit/selected_int_kind.cpp')
-rw-r--r-- | test/Unit/selected_int_kind.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/test/Unit/selected_int_kind.cpp b/test/Unit/selected_int_kind.cpp new file mode 100644 index 0000000..78b431b --- /dev/null +++ b/test/Unit/selected_int_kind.cpp @@ -0,0 +1,35 @@ +//===-- selected_int_kind.cpp - Test libflang_selected_int_kind -----------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +#include <assert.h> +#include <iostream> +#include "Core/Core.h" + +static bool test(int32_t x, int32_t expected) { + x = libflang_selected_int_kind(x); + if(x != expected) + std::cout << "Error in libflang_selected_int_kind - expected " << expected + << ", got " << x << std::endl; + return x != expected; +} + +int main() { + if(test(-2, 1)) + return 1; + if(test(1,1)) + return 1; + if(test(7,4)) + return 1; + if(test(13,8)) + return 1; + if(test(1000,-1)) + return 1; + return 0; +} + |