aboutsummaryrefslogtreecommitdiff
path: root/test/SemaCXX/ast-print.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaCXX/ast-print.cpp')
-rw-r--r--test/SemaCXX/ast-print.cpp46
1 files changed, 45 insertions, 1 deletions
diff --git a/test/SemaCXX/ast-print.cpp b/test/SemaCXX/ast-print.cpp
index a1975b4ac264..4851571283f4 100644
--- a/test/SemaCXX/ast-print.cpp
+++ b/test/SemaCXX/ast-print.cpp
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -ast-print %s | FileCheck %s
+// RUN: %clang_cc1 -ast-print %s -std=gnu++11 | FileCheck %s
// CHECK: r;
// CHECK-NEXT: (r->method());
@@ -164,3 +164,47 @@ void test13() {
void test14() {
struct X { union { int x; } x; };
}
+
+
+// CHECK: float test15() {
+// CHECK: return __builtin_asinf(1.F);
+// CHECK: }
+// CHECK-NOT: extern "C"
+float test15() {
+ return __builtin_asinf(1.0F);
+}
+
+namespace PR18776 {
+struct A {
+ operator void *();
+ explicit operator bool();
+ A operator&(A);
+};
+
+// CHECK: struct A
+// CHECK-NEXT: {{^[ ]*operator}} void *();
+// CHECK-NEXT: {{^[ ]*explicit}} operator bool();
+
+void bar(void *);
+
+void foo() {
+ A a, b;
+ bar(a & b);
+// CHECK: bar(a & b);
+ if (a & b)
+// CHECK: if (a & b)
+ return;
+}
+};
+
+namespace {
+void test(int i) {
+ switch (i) {
+ case 1:
+ // CHECK: {{\[\[clang::fallthrough\]\]}}
+ [[clang::fallthrough]];
+ case 2:
+ break;
+ }
+}
+}