aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorEnea Zaffanella <zaffanella@cs.unipr.it>2013-02-15 20:09:55 +0000
committerEnea Zaffanella <zaffanella@cs.unipr.it>2013-02-15 20:09:55 +0000
commit3285c78041f80a26f6a947e2922e15c4af6e00bb (patch)
tree948643ba8bb27e8a497d144d6022df1d081d07d0 /test
parentdc2efa1c10c4646d692cc57db9fdbbebe3a48255 (diff)
Fixed diagnostic nondeterministic order bug (pr14901).
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@175289 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r--test/Sema/uninit-det-order.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/test/Sema/uninit-det-order.c b/test/Sema/uninit-det-order.c
new file mode 100644
index 0000000000..041c4b0f89
--- /dev/null
+++ b/test/Sema/uninit-det-order.c
@@ -0,0 +1,13 @@
+// RUN: %clang_cc1 -Wuninitialized -fsyntax-only %s 2>&1 | FileCheck %s
+
+void pr14901(int a) {
+ int b, c;
+ a = b;
+ a = c;
+}
+
+// CHECK: 5:8: warning: variable 'b' is uninitialized when used here
+// CHECK: 4:9: note: initialize the variable 'b' to silence this warning
+// CHECK: 6:8: warning: variable 'c' is uninitialized when used here
+// CHECK: 4:12: note: initialize the variable 'c' to silence this warning
+