1 // Test without serialization: 2 // RUN: %clang_cc1 -fsyntax-only -triple x86_64-pc-linux -std=c++11 -ast-dump %s \ 3 // RUN: | FileCheck --strict-whitespace %s 4 5 // Test with serialization: 6 // RUN: %clang_cc1 -triple x86_64-pc-linux -emit-pch -o %t %s 7 // RUN: %clang_cc1 -x c++ -triple x86_64-pc-linux -include-pch %t -ast-dump-all /dev/null \ 8 // RUN: | sed -e "s/ <undeserialized declarations>//" -e "s/ imported//" \ 9 // RUN: | FileCheck --strict-whitespace %s 10 11 float func_01(float x); 12 13 template <typename T> 14 T func_02(T x) { 15 #pragma STDC FP_CONTRACT ON 16 return func_01(x); 17 } 18 19 float func_03(float x) { 20 #pragma STDC FP_CONTRACT OFF 21 return func_02(x); 22 } 23 24 // CHECK: FunctionTemplateDecl {{.*}} func_02 25 // CHECK: FunctionDecl {{.*}} func_02 'float (float)' 26 // CHECK-NEXT: TemplateArgument type 'float' 27 // CHECK-NEXT: BuiltinType {{.*}} 'float' 28 // CHECK-NEXT: ParmVarDecl {{.*}} x 'float' 29 // CHECK-NEXT: CompoundStmt 30 // CHECK-NEXT: ReturnStmt 31 // CHECK-NEXT: CallExpr {{.*}} FPContractMode=1 32 33 // CHECK: FunctionDecl {{.*}} func_03 'float (float)' 34 // CHECK-NEXT: ParmVarDecl {{.*}} x 'float' 35 // CHECK-NEXT: CompoundStmt 36 // CHECK-NEXT: ReturnStmt 37 // CHECK-NEXT: CallExpr {{.*}} FPContractMode=0