aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/PCH/pragma-diag-section.cpp5
-rw-r--r--test/PCH/pragma-diag.c3
-rw-r--r--test/PCH/rdar8852495.c3
-rw-r--r--test/Preprocessor/pragma_diagnostic_sections.cpp8
4 files changed, 12 insertions, 7 deletions
diff --git a/test/PCH/pragma-diag-section.cpp b/test/PCH/pragma-diag-section.cpp
index 312f720ebd..5b996bb2f0 100644
--- a/test/PCH/pragma-diag-section.cpp
+++ b/test/PCH/pragma-diag-section.cpp
@@ -12,7 +12,10 @@
#pragma clang diagnostic ignored "-Wtautological-compare"
template <typename T>
struct TS {
- void m() { T b = b==b; }
+ void m() {
+ T a = 0;
+ T b = a==a;
+ }
};
#pragma clang diagnostic pop
diff --git a/test/PCH/pragma-diag.c b/test/PCH/pragma-diag.c
index c517103640..b304c4bf8c 100644
--- a/test/PCH/pragma-diag.c
+++ b/test/PCH/pragma-diag.c
@@ -13,7 +13,8 @@
#else
void f() {
- int b = b==b;
+ int a = 0;
+ int b = a==a;
}
#endif
diff --git a/test/PCH/rdar8852495.c b/test/PCH/rdar8852495.c
index 2d49e001b0..fb465a37ce 100644
--- a/test/PCH/rdar8852495.c
+++ b/test/PCH/rdar8852495.c
@@ -16,7 +16,8 @@
#else
int f() {
- int b = b==b;
+ int a;
+ int b = a==a;
unsigned x;
signed y;
return x == y;
diff --git a/test/Preprocessor/pragma_diagnostic_sections.cpp b/test/Preprocessor/pragma_diagnostic_sections.cpp
index 69436b0bd8..b680fae5b9 100644
--- a/test/Preprocessor/pragma_diagnostic_sections.cpp
+++ b/test/Preprocessor/pragma_diagnostic_sections.cpp
@@ -2,14 +2,14 @@
// rdar://8365684
struct S {
- void m1() { int b = b==b; } // expected-warning {{always evaluates to true}}
+ void m1() { int b; while (b==b); } // expected-warning {{always evaluates to true}}
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wtautological-compare"
- void m2() { int b = b==b; }
+ void m2() { int b; while (b==b); }
#pragma clang diagnostic pop
- void m3() { int b = b==b; } // expected-warning {{always evaluates to true}}
+ void m3() { int b; while (b==b); } // expected-warning {{always evaluates to true}}
};
//------------------------------------------------------------------------------
@@ -18,7 +18,7 @@ struct S {
#pragma clang diagnostic ignored "-Wtautological-compare"
template <typename T>
struct TS {
- void m() { T b = b==b; }
+ void m() { T b; while (b==b); }
};
#pragma clang diagnostic pop