2 // RUN: split-file %s %t
5 // RUN: %clang_cc1 -std=c++20 -fopenmp -triple x86_64-unknown-linux-gnu %t/AssumeMod.cppm -emit-module-interface -o %t/AssumeMod.pcm
6 // RUN: %clang_cc1 -std=c++20 -fopenmp -triple x86_64-unknown-linux-gnu %t/UseAssumeMod.cpp -fmodule-file=AssumeMod=%t/AssumeMod.pcm -ast-dump-all | FileCheck %t/AssumeMod.cppm
8 // expected-no-diagnostics
12 export module AssumeMod
;
13 export
template<int N
> int foo(int y
) {
15 #pragma omp assume holds(y == N)
22 export
template<bool B
> void bar(int *z
) {
24 #pragma omp assume no_openmp
29 #pragma omp assume contains(target, parallel) absent(loop)
36 // CHECK: FunctionTemplateDecl 0x{{.*}}
37 // CHECK: OMPAssumeDirective 0x{{.*}} <line:5:1, col:33>
38 // CHECK-NEXT: OMPHoldsClause 0x{{.*}} <col:20, col:32>
40 // CHECK: FunctionDecl 0x{{.*}} implicit_instantiation
41 // CHECK: OMPAssumeDirective 0x{{.*}} <line:5:1, col:33>
42 // CHECK-NEXT: OMPHoldsClause 0x{{.*}} <col:20, col:32>
44 // CHECK: FunctionTemplateDecl 0x{{.*}}
45 // CHECK: OMPAssumeDirective 0x{{.*}} <line:14:1, col:29>
46 // CHECK-NEXT: OMPNo_openmpClause 0x{{.*}} <col:20, col:29>
47 // CHECK: OMPAssumeDirective 0x{{.*}} <line:19:1, col:59>
48 // CHECK-NEXT: OMPContainsClause 0x{{.*}} <col:20, col:45>
49 // CHECK-NEXT: OMPAbsentClause 0x{{.*}} <col:47, col:58>
51 // CHECK: FunctionDecl 0x{{.*}} implicit_instantiation
52 // CHECK: OMPAssumeDirective 0x{{.*}} <line:14:1, col:29>
53 // CHECK-NEXT: OMPNo_openmpClause 0x{{.*}} <col:20, col:29>
55 // CHECK: FunctionDecl 0x{{.*}} implicit_instantiation
56 // CHECK: OMPAssumeDirective 0x{{.*}} <line:19:1, col:59>
57 // CHECK-NEXT: OMPContainsClause 0x{{.*}} <col:20, col:45>
58 // CHECK-NEXT: OMPAbsentClause 0x{{.*}} <col:47, col:58>
60 //--- UseAssumeMod.cpp
63 extern "C" int printf(const char* fmt
, ...);
66 printf ("foo(5)=%d\n", foo
<5> (5));
67 int arr
[2] = { 0, 0 };
70 printf ("arr[0]=%d, arr[1]=%d\n", arr
[0], arr
[1]);