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
This commit is contained in:
Richard Trieu 2016-04-11 20:37:04 +00:00
parent aebe45b31e
commit 729c8e9793
2 changed files with 14 additions and 4 deletions

View File

@ -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);

View File

@ -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);