+// Test without serialization:
// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c++ -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
template<int N = 0>
void pr43370() {
foo();
}
-// CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <{{[^,]+}}, line:7:1> line:4:6 pr43370
+// CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <{{[^,]+}}, line:{{.*}}:1> line:{{.*}}:6 pr43370
// CHECK: AtomicExpr
// CHECK-NEXT: ImplicitCastExpr
// CHECK-SAME: <ArrayToPointerDecay>
// CHECK-NEXT: DeclRefExpr 0x{{[0-9a-f]+}} <{{[^:]+}}:20> 'int [2]' lvalue Var 0x{{[0-9a-f]+}} 'arr' 'int [2]'
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:28> 'int' 5
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:25> 'int' 0
-// CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:4:1, line:7:1> line:4:6 used pr43370
+// CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 used pr43370
// CHECK: AtomicExpr
// CHECK-NEXT: ImplicitCastExpr
// CHECK-SAME: <ArrayToPointerDecay>
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:28> 'int' 5
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:25> 'int' 0
-// CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <line:9:1, line:13:1> line:10:6 foo
+// CHECK:FunctionTemplateDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 foo
// CHECK: AtomicExpr
// CHECK-NEXT: ImplicitCastExpr
// CHECK-SAME: <ArrayToPointerDecay>
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:47> 'int' 1
// CHECK-NEXT: ImplicitCastExpr
// CHECK-NEXT: IntegerLiteral 0x{{[0-9a-f]+}} <{{[^:]+}}:50> 'int' 0
-// CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:10:1, line:13:1> line:10:6 used foo
+// CHECK:FunctionDecl 0x{{[0-9a-f]+}} <line:{{.*}}:1, line:{{.*}}:1> line:{{.*}}:6 used foo
// CHECK: AtomicExpr
// CHECK-NEXT: ImplicitCastExpr
// CHECK-SAME: <ArrayToPointerDecay>
+// Test without serialization:
// RUN: %clang_cc1 -w -ast-dump %s | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -w -emit-pch -o %t %s
+// RUN: %clang_cc1 -w -x c -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
// The cast construction code both for implicit and c-style casts is very
// different in C vs C++. This file is intended to test the C behavior.
+// Test without serialization:
// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -ast-dump %s | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -x objective-c -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
+//
// expected-no-diagnostics
__attribute__ ((external_source_symbol(language= "Swift", defined_in="A")))
+// Test without serialization:
// RUN: %clang_cc1 -triple x86_64-apple-darwin9 %s -std=c++14 -fcoroutines-ts \
// RUN: -fsyntax-only -ast-dump | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-apple-darwin9 -std=c++14 -fcoroutines-ts -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c++ -triple x86_64-apple-darwin9 -std=c++14 -fcoroutines-ts -include-pch %t \
+// RUN: -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
+
#include "Inputs/std-coroutine.h"
using namespace std::experimental;
+// Test without serialization:
// RUN: %clang_cc1 -fsyntax-only %s -ast-dump -std=c++17 | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -std=c++17 -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c++ -std=c++17 -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
namespace PR46111 {
template <typename>
+// Test without serialization:
// RUN: %clang_cc1 -x c -ffixed-point -ast-dump %s | FileCheck %s --strict-whitespace
+//
+// Test with serialization:
+// RUN: %clang_cc1 -ffixed-point -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -ffixed-point -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s --strict-whitespace
/* Various contexts where type _Accum can appear. */
+// Tests without serialization:
// RUN: %clang_cc1 -ast-dump -ffixed-point %s | FileCheck %s
// RUN: %clang_cc1 -ast-dump -ffixed-point -fpadding-on-unsigned-fixed-point %s | FileCheck %s
+//
+// Tests with serialization:
+// RUN: %clang_cc1 -ffixed-point -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -ffixed-point -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
+//
+// RUN: %clang_cc1 -ffixed-point -fpadding-on-unsigned-fixed-point -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -ffixed-point -fpadding-on-unsigned-fixed-point -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
/**
* Check the same values are printed in the AST regardless of if unsigned types
-// RUN: %clang_cc1 -std=c++11 -ast-dump -triple aarch64-linux-gnu %s | FileCheck %s --strict-whitespace\r
-// RUN: %clang_cc1 -std=c++11 -ast-dump -triple aarch64-linux-gnu -fnative-half-type %s | FileCheck %s --check-prefix=CHECK-NATIVE --strict-whitespace\r
+// Tests without serialization:\r
+// RUN: %clang_cc1 -std=c++11 -ast-dump -triple aarch64-linux-gnu %s \\r
+// RUN: | FileCheck %s --strict-whitespace\r
+//\r
+// RUN: %clang_cc1 -std=c++11 -ast-dump -triple aarch64-linux-gnu -fnative-half-type %s \\r
+// RUN: | FileCheck %s --check-prefix=CHECK-NATIVE --strict-whitespace\r
+//\r
+// Tests with serialization:\r
+// RUN: %clang_cc1 -std=c++11 -triple aarch64-linux-gnu -emit-pch -o %t %s\r
+// RUN: %clang_cc1 -x c++ -std=c++11 -triple aarch64-linux-gnu -include-pch %t -ast-dump-all /dev/null \\r
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \\r
+// RUN: | FileCheck %s --strict-whitespace\r
+//\r
+// RUN: %clang_cc1 -std=c++11 -triple aarch64-linux-gnu -fnative-half-type -emit-pch -o %t %s\r
+// RUN: %clang_cc1 -x c++ -std=c++11 -triple aarch64-linux-gnu -fnative-half-type -include-pch %t -ast-dump-all /dev/null \\r
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \\r
+// RUN: | FileCheck %s --check-prefix=CHECK-NATIVE --strict-whitespace\r
\r
/* Various contexts where type _Float16 can appear. */\r
\r
+// Test without serialization:
// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
void foo1(void*);
void foo2(void* const);
+// Test without serialization:
// RUN: %clang_cc1 %s -ast-dump | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c++ -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
// Verify that the language address space attribute is
// understood correctly by clang.
+// Test without serialization:
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -ast-dump %s | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -triple x86_64-linux-gnu -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
// We are checking that implicit casts don't get marked with 'part_of_explicit_cast',
// while in explicit casts, the implicitly-inserted implicit casts are marked with 'part_of_explicit_cast'
+// Test without serialization:
// RUN: %clang_cc1 -triple x86_64-linux-gnu -fsyntax-only -ast-dump %s | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-linux-gnu -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c++ -triple x86_64-linux-gnu -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
// We are checking that implicit casts don't get marked with 'part_of_explicit_cast',
// while in explicit casts, the implicitly-inserted implicit casts are marked with 'part_of_explicit_cast'
+// Test without serialization:
// RUN: %clang_cc1 -fsyntax-only %s -ast-dump | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c++ -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
struct B { _Alignas(64) struct { int b; }; };
-// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -ast-dump "%s" | FileCheck %s
+// Test without serialization:
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -ast-dump "%s" \
+// RUN: | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -emit-pch -o %t %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.10 -x objective-c -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
// CHECK: TypedefDecl {{.*}} referenced AtomicBool '_Atomic(_Bool)'
// CHECK: AtomicType {{.*}} '_Atomic(_Bool)'
+// Test without serialization:
// RUN: %clang_cc1 -fsyntax-only %s -std=c++11 -ast-dump | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -std=c++11 -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c++ -std=c++11 -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
+
template<typename T>
void f(T t) {
T a[] = {t};
+// Test without serialization:
// RUN: %clang_cc1 -ast-dump %s | FileCheck %s
+//
+// Test with serialization:
+// RUN: %clang_cc1 -emit-pch -o %t %s
+// RUN: %clang_cc1 -x c -include-pch %t -ast-dump-all /dev/null \
+// RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \
+// RUN: | FileCheck %s
void variadic(int, ...);