summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorGeorge Karpenkov <ekarpenkov@apple.com>2018-08-29 21:18:47 +0000
committerGeorge Karpenkov <ekarpenkov@apple.com>2018-08-29 21:18:47 +0000
commite12dcf124bc7562f520055b6dce59382a3511983 (patch)
tree7d9fb3eb37ee434ed3ea60d7560960edea7aad73 /clang/test
parent51e1a83850cd5aac1290822352b3fc1cae0032eb (diff)
downloadbcm5719-llvm-e12dcf124bc7562f520055b6dce59382a3511983.tar.gz
bcm5719-llvm-e12dcf124bc7562f520055b6dce59382a3511983.zip
[analyzer] Fix tests on 32-bit platforms by specifying the tuple explicitly
llvm-svn: 340972
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Analysis/casts.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/clang/test/Analysis/casts.c b/clang/test/Analysis/casts.c
index 3e6a9e05951..45ce1940dfa 100644
--- a/clang/test/Analysis/casts.c
+++ b/clang/test/Analysis/casts.c
@@ -1,6 +1,7 @@
// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s
// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -analyzer-store=region -verify -analyzer-config eagerly-assume=false %s
-// RUN: %clang_analyze_cc1 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -DEAGERLY_ASSUME=1 -w %s
+// RUN: %clang_analyze_cc1 -triple x86_64-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -DEAGERLY_ASSUME=1 -w %s
+// RUN: %clang_analyze_cc1 -triple i386-apple-darwin9 -analyzer-checker=core,alpha.core,debug.ExprInspection -verify -DEAGERLY_ASSUME=1 -DBIT32=1 -w %s
extern void clang_analyzer_eval(_Bool);
@@ -196,16 +197,19 @@ void testSwitchWithSizeofs() {
#ifdef EAGERLY_ASSUME
-// expected-no-diagnostics
-
-int globalA; // TODO: the example is not representative.
+int globalA;
extern int globalFunc();
void no_crash_on_symsym_cast_to_long() {
char c = globalFunc() - 5;
c == 0;
globalA -= c;
globalA == 3;
- (long)globalA << 48; // no-crash
+ (long)globalA << 48;
+ #ifdef BIT32
+ // expected-warning@-2{{The result of the left shift is undefined due to shifting by '48', which is greater or equal to the width of type 'long'}}
+ #else
+ // expected-no-diagnostics
+ #endif
}
#endif
OpenPOWER on IntegriCloud