Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(149)

Side by Side Diff: test/Sema/atomic-compare.c

Issue 1238843002: Cherry-pick upstream r238083 (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-clang.git@master
Patch Set: Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Sema/SemaChecking.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // RUN: %clang_cc1 %s -verify -fsyntax-only 1 // RUN: %clang_cc1 %s -verify -fsyntax-only
2 2
3 void f(_Atomic(int) a, _Atomic(int) b) { 3 void f(_Atomic(int) a, _Atomic(int) b) {
4 if (a > b) {} // no warning 4 if (a > b) {} // no warning
5 if (a < b) {} // no warning 5 if (a < b) {} // no warning
6 if (a >= b) {} // no warning 6 if (a >= b) {} // no warning
7 if (a <= b) {} // no warning 7 if (a <= b) {} // no warning
8 if (a == b) {} // no warning 8 if (a == b) {} // no warning
9 if (a != b) {} // no warning 9 if (a != b) {} // no warning
10 10
11 if (a == 0) {} // no warning 11 if (a == 0) {} // no warning
12 if (a > 0) {} // no warning 12 if (a > 0) {} // no warning
13 if (a > 1) {} // no warning 13 if (a > 1) {} // no warning
14 if (a > 2) {} // no warning 14 if (a > 2) {} // no warning
15 15
16 if (!a > 0) {} // no warning 16 if (!a > 0) {} // no warning
17 if (!a > 1) {} // expected-warning {{comparison of constant 1 with boolean expression is always false}} 17 if (!a > 1) {} // expected-warning {{comparison of constant 1 with boolean expression is always false}}
18 if (!a > 2) {} // expected-warning {{comparison of constant 2 with boolean expression is always false}} 18 if (!a > 2) {} // expected-warning {{comparison of constant 2 with boolean expression is always false}}
19 if (!a > b) {} // no warning 19 if (!a > b) {} // no warning
20 if (!a > -1) {} // expected-warning {{comparison of constant -1 with boolea n expression is always true}} 20 if (!a > -1) {} // expected-warning {{comparison of constant -1 with boolea n expression is always true}}
21 } 21 }
22
23 typedef _Atomic(int) Ty;
24 void PR23638(Ty *a) {
25 if (*a == 1) {} // no warning
26 }
OLDNEW
« no previous file with comments | « lib/Sema/SemaChecking.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698