summaryrefslogtreecommitdiff
path: root/test/Sema/integer-overflow.c
diff options
context:
space:
mode:
authorRichard Trieu <rtrieu@google.com>2016-04-11 20:37:04 +0000
committerRichard Trieu <rtrieu@google.com>2016-04-11 20:37:04 +0000
commit803616f6bc87d8a6d6f3fcd0bb3ce5755f1836ae (patch)
tree9967b9ebdd08563a8e5bf163942bf11f01c4db48 /test/Sema/integer-overflow.c
parent40fa3c989d7e8e4e9f45f7113b1977781d73763e (diff)
downloadclang-803616f6bc87d8a6d6f3fcd0bb3ce5755f1836ae.tar.gz
Adjust tests to have consistent integer sizes.
Add a triple to the run lines so that integers will the same sizes across runs. Also add a compile time check to ensure the assumptions about sizes are met. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@265991 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test/Sema/integer-overflow.c')
-rw-r--r--test/Sema/integer-overflow.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/Sema/integer-overflow.c b/test/Sema/integer-overflow.c
index 02d99b3fc5..e74bc11979 100644
--- a/test/Sema/integer-overflow.c
+++ b/test/Sema/integer-overflow.c
@@ -1,6 +1,11 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only
+// RUN: %clang_cc1 %s -verify -fsyntax-only -triple x86_64-pc-linux-gnu
typedef unsigned long long uint64_t;
-typedef unsigned long long uint32_t;
+typedef unsigned int uint32_t;
+
+// Check integer sizes.
+int array64[sizeof(uint64_t) == 8 ? 1 : -1];
+int array32[sizeof(uint32_t) == 4 ? 1 : -1];
+int arrayint[sizeof(int) < sizeof(uint64_t) ? 1 : -1];
uint64_t f0(uint64_t);
uint64_t f1(uint64_t, uint32_t);