summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2013-01-29 01:24:26 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2013-01-29 01:24:26 +0000
commit0cdcc98200b8b2c0dea21bae433677f88aae597c (patch)
tree76a13eca3ee3776405ecde8c75ba15be76d1f8bc /clang/test
parent3c94737fb71acdc3dc91255d11c3ccba496aba8a (diff)
downloadbcm5719-llvm-0cdcc98200b8b2c0dea21bae433677f88aae597c.tar.gz
bcm5719-llvm-0cdcc98200b8b2c0dea21bae433677f88aae597c.zip
Replace AS_MSTypespec with AS_Keyword, for representing any attribute spelled
as a keyword. Rationalize existing attributes to use it as appropriate, and to not lie about some __declspec attributes being GNU attributes. In passing, remove a gross hack which was discarding attributes which we could handle. This results in us actually respecting the __pascal keyword again. llvm-svn: 173746
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Sema/attr-print.c7
-rw-r--r--clang/test/SemaCXX/attr-print.cpp7
-rw-r--r--clang/test/SemaCXX/borland-extensions.cpp9
-rw-r--r--clang/test/SemaCXX/cxx11-attr-print.cpp7
4 files changed, 19 insertions, 11 deletions
diff --git a/clang/test/Sema/attr-print.c b/clang/test/Sema/attr-print.c
index f952e4b410a..5e4c0c2d1eb 100644
--- a/clang/test/Sema/attr-print.c
+++ b/clang/test/Sema/attr-print.c
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s
// FIXME: we need to fix the "BoolArgument<"IsMSDeclSpec">"
// hack in Attr.td for attribute "Aligned".
@@ -6,8 +6,9 @@
// CHECK: int x __attribute__((aligned(4, 0)));
int x __attribute__((aligned(4)));
-// CHECK: int y __attribute__((align(4, 0)));
-int y __attribute__((align(4)));
+// FIXME: Print this at a valid location for a __declspec attr.
+// CHECK: int y __declspec(align(4, 1));
+__declspec(align(4)) int y;
// CHECK: void foo() __attribute__((const));
void foo() __attribute__((const));
diff --git a/clang/test/SemaCXX/attr-print.cpp b/clang/test/SemaCXX/attr-print.cpp
index 317ba4d1574..419f608c04f 100644
--- a/clang/test/SemaCXX/attr-print.cpp
+++ b/clang/test/SemaCXX/attr-print.cpp
@@ -1,12 +1,13 @@
-// RUN: %clang_cc1 %s -ast-print | FileCheck %s
+// RUN: %clang_cc1 %s -ast-print -fms-extensions | FileCheck %s
// FIXME: align attribute print
// CHECK: int x __attribute__((aligned(4, 0)));
int x __attribute__((aligned(4)));
-// CHECK: int y __attribute__((align(4, 0)));
-int y __attribute__((align(4)));
+// FIXME: Print this at a valid location for a __declspec attr.
+// CHECK: int y __declspec(align(4, 1));
+__declspec(align(4)) int y;
// CHECK: void foo() __attribute__((const));
void foo() __attribute__((const));
diff --git a/clang/test/SemaCXX/borland-extensions.cpp b/clang/test/SemaCXX/borland-extensions.cpp
index 1e4bd45612f..f9414f8869a 100644
--- a/clang/test/SemaCXX/borland-extensions.cpp
+++ b/clang/test/SemaCXX/borland-extensions.cpp
@@ -1,5 +1,5 @@
-// RUN: %clang_cc1 %s -fsyntax-only -verify -fborland-extensions
-// expected-no-diagnostics
+// RUN: %clang_cc1 %s -fsyntax-only -fborland-extensions -triple x86_64-linux-gnu -verify
+// RUN: %clang_cc1 %s -fsyntax-only -fborland-extensions -triple i686-linux-gnu -Werror
// Borland extensions
@@ -9,13 +9,18 @@ int dummy_function() { return 0; }
// 2. test __pascal
int _pascal f2();
+// expected-warning@+1 {{calling convention '__pascal' ignored for this target}}
float __pascal gi2(int, int);
+// expected-warning@+1 {{calling convention '__pascal' ignored for this target}}
template<typename T> T g2(T (__pascal * const )(int, int)) { return 0; }
struct M {
+ // expected-warning@+1 {{calling convention '__pascal' ignored for this target}}
int __pascal addP();
+ // expected-warning@+1 {{calling convention '__pascal' ignored for this target}}
float __pascal subtractP();
};
+// expected-warning@+1 {{calling convention '__pascal' ignored for this target}}
template<typename T> int h2(T (__pascal M::* const )()) { return 0; }
void m2() {
int i; float f;
diff --git a/clang/test/SemaCXX/cxx11-attr-print.cpp b/clang/test/SemaCXX/cxx11-attr-print.cpp
index 985d9a44fef..3cc6d00f087 100644
--- a/clang/test/SemaCXX/cxx11-attr-print.cpp
+++ b/clang/test/SemaCXX/cxx11-attr-print.cpp
@@ -1,11 +1,12 @@
-// RUN: %clang_cc1 -std=c++11 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -std=c++11 -ast-print -fms-extensions %s | FileCheck %s
// FIXME: align attribute print
// CHECK: int x __attribute__((aligned(4, 0)));
int x __attribute__((aligned(4)));
-// CHECK: int y __attribute__((align(4, 0)));
-int y __attribute__((align(4)));
+// FIXME: Print this at a valid location for a __declspec attr.
+// CHECK: int y __declspec(align(4, 1));
+__declspec(align(4)) int y;
// CHECK: gnu::aligned(4, 0)]];
int z [[gnu::aligned(4)]];
OpenPOWER on IntegriCloud