summaryrefslogtreecommitdiffstats
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
commit729c8e9793b887e5da77d74488172ddc7b3ca855 (patch)
tree28c2219a170fa4225f73ee90990357f2843f6791
parentaebe45b31e8962278b74796a9a4ee4f737d0fe03 (diff)
downloadbcm5719-llvm-729c8e9793b887e5da77d74488172ddc7b3ca855.tar.gz
bcm5719-llvm-729c8e9793b887e5da77d74488172ddc7b3ca855.zip
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. llvm-svn: 265991
-rw-r--r--clang/test/Sema/integer-overflow.c9
-rw-r--r--clang/test/SemaCXX/integer-overflow.cpp9
2 files changed, 14 insertions, 4 deletions
diff --git a/clang/test/Sema/integer-overflow.c b/clang/test/Sema/integer-overflow.c
index 02d99b3fc5c..e74bc119798 100644
--- a/clang/test/Sema/integer-overflow.c
+++ b/clang/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);
diff --git a/clang/test/SemaCXX/integer-overflow.cpp b/clang/test/SemaCXX/integer-overflow.cpp
index 566bb05fa0c..a119f0eabe3 100644
--- a/clang/test/SemaCXX/integer-overflow.cpp
+++ b/clang/test/SemaCXX/integer-overflow.cpp
@@ -1,6 +1,11 @@
-// RUN: %clang_cc1 %s -verify -fsyntax-only -std=gnu++98
+// RUN: %clang_cc1 %s -verify -fsyntax-only -std=gnu++98 -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);
OpenPOWER on IntegriCloud