aboutsummaryrefslogtreecommitdiff
path: root/test/Sema
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-05-22 19:43:45 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-05-22 19:43:45 +0000
commitaa803409c3bd3930126db630c29f63d42f255153 (patch)
tree042106605c08352895ba4383ef97eae88b6b31aa /test/Sema
parent1ce08792766261dcaa25d8215f9d1c2f70d7b7e9 (diff)
downloadsrc-aa803409c3bd3930126db630c29f63d42f255153.tar.gz
src-aa803409c3bd3930126db630c29f63d42f255153.zip
Vendor import of clang trunk r303571:vendor/clang/clang-trunk-r303571
Notes
Notes: svn path=/vendor/clang/dist/; revision=318665 svn path=/vendor/clang/clang-trunk-r303571/; revision=318666; tag=vendor/clang/clang-trunk-r303571
Diffstat (limited to 'test/Sema')
-rw-r--r--test/Sema/attr-micromips.c17
-rw-r--r--test/Sema/block-args.c2
-rw-r--r--test/Sema/integer-overflow.c8
-rw-r--r--test/Sema/sizeof-struct-non-zero-as-member.cl2
4 files changed, 27 insertions, 2 deletions
diff --git a/test/Sema/attr-micromips.c b/test/Sema/attr-micromips.c
new file mode 100644
index 000000000000..fe587fa3db07
--- /dev/null
+++ b/test/Sema/attr-micromips.c
@@ -0,0 +1,17 @@
+// RUN: %clang_cc1 -triple mips-linux-gnu -fsyntax-only -verify %s
+
+__attribute__((nomicromips(0))) void foo1(); // expected-error {{'nomicromips' attribute takes no arguments}}
+__attribute__((micromips(1))) void foo2(); // expected-error {{'micromips' attribute takes no arguments}}
+
+__attribute((nomicromips)) int a; // expected-error {{attribute only applies to functions}}
+__attribute((micromips)) int b; // expected-error {{attribute only applies to functions}}
+
+__attribute__((micromips,mips16)) void foo5(); // expected-error {{'micromips' and 'mips16' attributes are not compatible}} \
+ // expected-note {{conflicting attribute is here}}
+__attribute__((mips16,micromips)) void foo6(); // expected-error {{'mips16' and 'micromips' attributes are not compatible}} \
+ // expected-note {{conflicting attribute is here}}
+
+__attribute((micromips)) void foo7();
+__attribute((nomicromips)) void foo8();
+__attribute__((mips16)) void foo9(void) __attribute__((micromips)); // expected-error {{'micromips' and 'mips16' attributes are not compatible}} \
+ // expected-note {{conflicting attribute is here}}
diff --git a/test/Sema/block-args.c b/test/Sema/block-args.c
index c6beead3915b..69cf047a9ece 100644
--- a/test/Sema/block-args.c
+++ b/test/Sema/block-args.c
@@ -37,7 +37,7 @@ void f0() {
// rdar://problem/8962770
void test4() {
- int (^f)() = ^((x)) { }; // expected-error {{expected ')'}} expected-warning {{type specifier missing}} expected-note {{to match this}}
+ int (^f)() = ^((x)) { }; // expected-warning {{type specifier missing}} expected-error {{type-id cannot have a name}}
}
// rdar://problem/9170609
diff --git a/test/Sema/integer-overflow.c b/test/Sema/integer-overflow.c
index 62ee33e3d181..c2b6ba209b71 100644
--- a/test/Sema/integer-overflow.c
+++ b/test/Sema/integer-overflow.c
@@ -151,6 +151,14 @@ uint64_t check_integer_overflows(int i) {
uint64_t *b;
uint64_t b2 = b[4608 * 1024 * 1024] + 1;
+// expected-warning@+1 {{overflow in expression; result is 536870912 with type 'int'}}
+ f0(4608 * 1024 * 1024);
+ f0(4608ul * 1024 * 1024);
+// expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}}
+ f1(4608 * 1024 * 1024, 4608 * 1024 * 1024);
+// expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}}
+ f2(4608 * 1024 * 1024, 4608 * 1024 * 1024);
+
// expected-warning@+1 2{{overflow in expression; result is 536870912 with type 'int'}}
int j1 = i ? (4608 * 1024 * 1024) : (4608 * 1024 * 1024);
diff --git a/test/Sema/sizeof-struct-non-zero-as-member.cl b/test/Sema/sizeof-struct-non-zero-as-member.cl
index 0e13c61503aa..cd959735fe81 100644
--- a/test/Sema/sizeof-struct-non-zero-as-member.cl
+++ b/test/Sema/sizeof-struct-non-zero-as-member.cl
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify -fsyntax-only -triple amdgcn -target-cpu verde -S -emit-llvm -o - %s
+// RUN: %clang_cc1 -verify -fsyntax-only -triple amdgcn--opencl -target-cpu verde -S -emit-llvm -o - %s
// expected-no-diagnostics
// Record lowering was crashing on SI and newer targets, because it