// Test without serialization: // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s \ // RUN: | FileCheck -strict-whitespace %s // // Test with serialization: // RUN: %clang_cc1 -triple x86_64-unknown-unknown -emit-pch -o %t %s // RUN: %clang_cc1 -x c++ -triple x86_64-unknown-unknown -include-pch %t -ast-dump-all /dev/null \ // RUN: | FileCheck -strict-whitespace %s enum E {}; void operator+(E,E); void operator,(E,E); void test() { E e; e + e; e , e; } // CHECK: TranslationUnitDecl {{.*}} <> {{( )?}} // CHECK: |-EnumDecl {{.*}} <{{.*}}ast-dump-overloaded-operators.cpp:10:1, col:9> col:6{{( imported)?}} referenced E // CHECK-NEXT: |-FunctionDecl {{.*}} col:6{{( imported)?}} used operator+ 'void (E, E)' // CHECK-NEXT: | |-ParmVarDecl {{.*}} col:17{{( imported)?}} 'E' // CHECK-NEXT: | `-ParmVarDecl {{.*}} col:19{{( imported)?}} 'E' // CHECK-NEXT: |-FunctionDecl {{.*}} col:6{{( imported)?}} used operator, 'void (E, E)' // CHECK-NEXT: | |-ParmVarDecl {{.*}} col:17{{( imported)?}} 'E' // CHECK-NEXT: | `-ParmVarDecl {{.*}} col:19{{( imported)?}} 'E' // CHECK-NEXT: `-FunctionDecl {{.*}} line:14:6{{( imported)?}} test 'void ()' // CHECK-NEXT: `-CompoundStmt {{.*}} // CHECK-NEXT: |-DeclStmt {{.*}} // CHECK-NEXT: | `-VarDecl {{.*}} col:5{{( imported)?}} used e 'E' // CHECK-NEXT: |-CXXOperatorCallExpr {{.*}} 'void' '+' // CHECK-NEXT: | |-ImplicitCastExpr {{.*}} 'void (*)(E, E)' // CHECK-NEXT: | | `-DeclRefExpr {{.*}} 'void (E, E)' lvalue Function {{.*}} 'operator+' 'void (E, E)' // CHECK-NEXT: | |-ImplicitCastExpr {{.*}} 'E' // CHECK-NEXT: | | `-DeclRefExpr {{.*}} 'E' lvalue Var {{.*}} 'e' 'E' // CHECK-NEXT: | `-ImplicitCastExpr {{.*}} 'E' // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'E' lvalue Var {{.*}} 'e' 'E' // CHECK-NEXT: `-CXXOperatorCallExpr {{.*}} 'void' ',' // CHECK-NEXT: |-ImplicitCastExpr {{.*}} 'void (*)(E, E)' // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'void (E, E)' lvalue Function {{.*}} 'operator,' 'void (E, E)' // CHECK-NEXT: |-ImplicitCastExpr {{.*}} 'E' // CHECK-NEXT: | `-DeclRefExpr {{.*}} 'E' lvalue Var {{.*}} 'e' 'E' // CHECK-NEXT: `-ImplicitCastExpr {{.*}} 'E' // CHECK-NEXT: `-DeclRefExpr {{.*}} 'E' lvalue Var {{.*}} 'e' 'E'