diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-29 05:41:51 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-11-29 05:41:51 +0000 |
| commit | e6a56db2e62eeaa62ec6cfaa099298ba3356b9fd (patch) | |
| tree | b5aec782243f9e01bc76d555438cad53e3334ad0 /clang/test/Sema/128bitint.c | |
| parent | 6be9b25cb628f66b8c697182bcf2fd181a3784ad (diff) | |
| download | bcm5719-llvm-e6a56db2e62eeaa62ec6cfaa099298ba3356b9fd.tar.gz bcm5719-llvm-e6a56db2e62eeaa62ec6cfaa099298ba3356b9fd.zip | |
Reject uses of __int128 on platforms that don't support it. Also move the ugly
'getPointerWidth(0) >= 64' test to be a method on TargetInfo, ready to be
properly cleaned up.
llvm-svn: 168856
Diffstat (limited to 'clang/test/Sema/128bitint.c')
| -rw-r--r-- | clang/test/Sema/128bitint.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/Sema/128bitint.c b/clang/test/Sema/128bitint.c index 600c25a630c..bb8e3d155e5 100644 --- a/clang/test/Sema/128bitint.c +++ b/clang/test/Sema/128bitint.c @@ -1,9 +1,13 @@ -// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin9 -fms-extensions %s +// RUN: %clang_cc1 -fsyntax-only -verify -triple x86_64-apple-darwin9 -fms-extensions %s -DHAVE +// RUN: %clang_cc1 -fsyntax-only -verify -triple i686-linux-gnu -fms-extensions %s -DHAVE_NOT + +#ifdef HAVE typedef int i128 __attribute__((__mode__(TI))); typedef unsigned u128 __attribute__((__mode__(TI))); int a[((i128)-1 ^ (i128)-2) == 1 ? 1 : -1]; int a[(u128)-1 > 1LL ? 1 : -1]; +int a[__SIZEOF_INT128__ == 16 ? 1 : -1]; // PR5435 __uint128_t b = (__uint128_t)-1; @@ -36,4 +40,12 @@ void test(int *buf) { MPI_Send(buf, 0x10000000000000001i128); // expected-warning {{implicit conversion from '__int128' to 'int' changes value}} } +#else + +__int128 n; // expected-error {{__int128 is not supported on this target}} + +#if defined(__SIZEOF_INT128__) +#error __SIZEOF_INT128__ should not be defined +#endif +#endif |

