aboutsummaryrefslogtreecommitdiff
path: root/test/Sema/builtin-assume.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/Sema/builtin-assume.c')
-rw-r--r--test/Sema/builtin-assume.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/Sema/builtin-assume.c b/test/Sema/builtin-assume.c
new file mode 100644
index 000000000000..1f6a3a0cd910
--- /dev/null
+++ b/test/Sema/builtin-assume.c
@@ -0,0 +1,11 @@
+// RUN: %clang_cc1 -triple i386-mingw32 -fms-extensions -fsyntax-only -verify %s
+
+int foo(int *a, int i) {
+ __assume(i != 4);
+ __assume(++i > 2); //expected-warning {{the argument to __assume has side effects that will be discarded}}
+
+ int test = sizeof(struct{char qq[(__assume(i != 5), 7)];});
+
+ return a[i];
+}
+