summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorReid Kleckner <reid@kleckner.net>2013-11-13 22:47:22 +0000
committerReid Kleckner <reid@kleckner.net>2013-11-13 22:47:22 +0000
commitcf8933d1b79455dc13e76fecb114f286bc3c19d0 (patch)
treeb052d21138d816fe7a35f56814d29333c9da94ac /clang/test
parent21fee96f69742e3f2168a03de86b949fbd8094f7 (diff)
downloadbcm5719-llvm-cf8933d1b79455dc13e76fecb114f286bc3c19d0.tar.gz
bcm5719-llvm-cf8933d1b79455dc13e76fecb114f286bc3c19d0.zip
Only provide MS builtins when -fms-extensions is on
We already have builtins that are only available in GNU mode, so this mirrors that. Reviewers: rsmith Differential Revision: http://llvm-reviews.chandlerc.com/D2128 llvm-svn: 194615
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CodeGen/builtin-ms-noop.cpp2
-rw-r--r--clang/test/Sema/builtins.c6
-rw-r--r--clang/test/SemaCXX/builtins.cpp6
3 files changed, 13 insertions, 1 deletions
diff --git a/clang/test/CodeGen/builtin-ms-noop.cpp b/clang/test/CodeGen/builtin-ms-noop.cpp
index 42c25016b13..7c5068dd61b 100644
--- a/clang/test/CodeGen/builtin-ms-noop.cpp
+++ b/clang/test/CodeGen/builtin-ms-noop.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -triple i686-pc-win32 -emit-llvm %s -o - | FileCheck %s
+// RUN: %clang_cc1 -fms-extensions -triple i686-pc-win32 -emit-llvm %s -o - | FileCheck %s
class A {
public:
diff --git a/clang/test/Sema/builtins.c b/clang/test/Sema/builtins.c
index 33b09543819..8ca33c8e752 100644
--- a/clang/test/Sema/builtins.c
+++ b/clang/test/Sema/builtins.c
@@ -191,3 +191,9 @@ void test18() {
ptr = __builtin___strlcpy_chk(dst, src, sizeof(src), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
ptr = __builtin___strlcat_chk(dst, src, sizeof(src), sizeof(dst)); // expected-warning {{incompatible integer to pointer conversion}}
}
+
+void no_ms_builtins() {
+ __assume(1); // expected-warning {{implicit declaration}}
+ __noop(1); // expected-warning {{implicit declaration}}
+ __debugbreak(); // expected-warning {{implicit declaration}}
+}
diff --git a/clang/test/SemaCXX/builtins.cpp b/clang/test/SemaCXX/builtins.cpp
index 63aa711d62d..69bdfa61451 100644
--- a/clang/test/SemaCXX/builtins.cpp
+++ b/clang/test/SemaCXX/builtins.cpp
@@ -38,3 +38,9 @@ namespace addressof {
S *ptmp = __builtin_addressof(S{}); // expected-error {{taking the address of a temporary}}
}
+
+void no_ms_builtins() {
+ __assume(1); // expected-error {{use of undeclared}}
+ __noop(1); // expected-error {{use of undeclared}}
+ __debugbreak(); // expected-error {{use of undeclared}}
+}
OpenPOWER on IntegriCloud