Files
RedBear-OS/local/recipes/dev/libclc/source/clang/test/SemaOpenACC/data-construct-async-ast.cpp
T
vasilito cb424d7448 build: static patch-sanity linter (shift-left the malformed-patch class)
verify-patch-sanity.py validates every active recipe .patch has internally-
consistent hunk line counts — catching the 'malformed patch at line N' failure
at commit/CI/preflight time instead of hours into a cook. This cycle hit that
class three times (qtwaylandscanner, sddm, xwayland), each only discovered when
cookbook tried to apply the patch.

Running it across the repo found 29 latent malformed patches (validated against
GNU patch: e.g. relibc/P3-sysv-ipc reproduces 'malformed patch at line 22').
They were harmless only because they sit in vendored recipes (baked, not re-
applied) — but would fail on any version-bump re-derivation. --fix recounts the
hunk headers (body untouched) and repaired all 29.

Wired into build-preflight.sh (Phase 1.0D) and redbear-ci.yml, with a unit test
(test-patch-sanity.sh). Skips archived/legacy trees and unvalidatable formats
(empty placeholders, bare-@@ git hunks).
2026-08-01 05:13:02 +03:00

79 lines
2.3 KiB
C++

// RUN: %clang_cc1 %s -fopenacc -ast-dump | FileCheck %s
// Test this with PCH.
// RUN: %clang_cc1 %s -fopenacc -emit-pch -o %t %s
// RUN: %clang_cc1 %s -fopenacc -include-pch %t -ast-dump-all | FileCheck %s
#ifndef PCH_HELPER
#define PCH_HELPER
int some_int();
template<typename T>
void TemplUses() {
// CHECK: FunctionTemplateDecl{{.*}}TemplUses
// CHECK-NEXT: TemplateTypeParmDecl{{.*}}T
// CHECK-NEXT: FunctionDecl{{.*}}TemplUses
// CHECK-NEXT: CompoundStmt
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl
T t;
#pragma acc data default(none) async(some_int())
;
// CHECK-NEXT: OpenACCDataConstruct{{.*}}data
// CHECK-NEXT: default(none)
// CHECK-NEXT: async clause
// CHECK-NEXT: CallExpr{{.*}}'int'
// CHECK-NEXT: ImplicitCastExpr
// CHECK-NEXT: DeclRefExpr{{.*}}'some_int' 'int ()'
// CHECK-NEXT: NullStmt
#pragma acc enter data copyin(t) async(T{})
// CHECK-NEXT: OpenACCEnterDataConstruct{{.*}}enter data
// CHECK-NEXT: copyin clause
// CHECK-NEXT: DeclRefExpr{{.*}}'t' 'T'
// CHECK-NEXT: async clause
// CHECK-NEXT: CXXUnresolvedConstructExpr{{.*}} 'T' 'T' list
// CHECK-NEXT: InitListExpr{{.*}}'void'
#pragma acc exit data copyout(t) async
// CHECK-NEXT: OpenACCExitDataConstruct{{.*}}exit data
// CHECK-NEXT: copyout clause
// CHECK-NEXT: DeclRefExpr{{.*}}'t' 'T'
// CHECK-NEXT: async clause
// Instantiations
// CHECK-NEXT: FunctionDecl{{.*}} TemplUses 'void ()' implicit_instantiation
// CHECK-NEXT: TemplateArgument type 'int'
// CHECK-NEXT: BuiltinType{{.*}} 'int'
// CHECK-NEXT: CompoundStmt
// CHECK-NEXT: DeclStmt
// CHECK-NEXT: VarDecl
// CHECK-NEXT: OpenACCDataConstruct{{.*}}data
// CHECK-NEXT: default(none)
// CHECK-NEXT: async clause
// CHECK-NEXT: CallExpr{{.*}}'int'
// CHECK-NEXT: ImplicitCastExpr
// CHECK-NEXT: DeclRefExpr{{.*}}'some_int' 'int ()'
// CHECK-NEXT: NullStmt
// CHECK-NEXT: OpenACCEnterDataConstruct{{.*}}enter data
// CHECK-NEXT: copyin clause
// CHECK-NEXT: DeclRefExpr{{.*}}'t' 'int'
// CHECK-NEXT: async clause
// CHECK-NEXT: CXXFunctionalCastExpr
// CHECK-NEXT: InitListExpr{{.*}}'int'
// CHECK-NEXT: OpenACCExitDataConstruct{{.*}}exit data
// CHECK-NEXT: copyout clause
// CHECK-NEXT: DeclRefExpr{{.*}}'t' 'int'
// CHECK-NEXT: async clause
}
void Inst() {
TemplUses<int>();
}
#endif // PCH_HELPER