| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| // RUN: %clang -S -### -fopenacc %s 2>&1 | FileCheck %s --check-prefix=CHECK-DRIVER | ||
| // CHECK-DRIVER: "-cc1" {{.*}} "-fopenacc" | ||
bcardosolopes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| // RUN: %clang -S -### -fopenacc -fexperimental-openacc-macro-override=202211 %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACRO-OVERRIDE | ||
| // RUN: %clang -S -### -fopenacc -fexperimental-openacc-macro-override 202211 %s 2>&1 | FileCheck %s --check-prefix=CHECK-MACRO-OVERRIDE | ||
|
There was a problem hiding this comment. Why do you need this new option fexperimental-openacc-macro-override? Can you just rely on -D_OPENACC instead? There was a problem hiding this comment. We cannot, because this is a 'builtin' macro, overriding it on the command line is essentially UB. Additionally, this clarifies that it is an experimental patch, which is less likely to be a concern when we remove it in the future. That is, the intent is to prevent folks from coming to depend on this in the future. |
||
| // CHECK-MACRO-OVERRIDE: "-cc1"{{.*}} "-fexperimental-openacc-macro-override" "202211" | ||
|
|
||
| // RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override=202211L %s 2>&1 | FileCheck %s --check-prefix=INVALID | ||
| // RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override 202211L %s 2>&1 | FileCheck %s --check-prefix=INVALID | ||
| // RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override=L202211 %s 2>&1 | FileCheck %s --check-prefix=INVALID | ||
| // RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override L202211 %s 2>&1 | FileCheck %s --check-prefix=INVALID | ||
| // RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override=2022L11 %s 2>&1 | FileCheck %s --check-prefix=INVALID | ||
| // RUN: not %clang -S -fopenacc -fexperimental-openacc-macro-override 2022L11 %s 2>&1 | FileCheck %s --check-prefix=INVALID | ||
| // INVALID: error: the clang compiler does not support | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,4 @@ | ||
| // RUN: %clang_cc1 %s -verify -Wsource-uses-openacc | ||
| // expected-warning@+1{{unexpected '#pragma acc ...' in program}} | ||
| #pragma acc foo bar baz blitz. | ||
| int foo; |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // RUN: %clang_cc1 %s -verify -fopenacc | ||
|
|
||
| // Parser::ParseExternalDeclaration | ||
| // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
| #pragma acc not yet implemented | ||
| int foo; | ||
|
|
||
| struct S { | ||
| // Parser::ParseStructUnionBody | ||
| // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
| #pragma acc not yet implemented | ||
| int foo; | ||
| }; | ||
|
|
||
| void func() { | ||
| // Parser::ParseStmtOrDeclarationAfterAttributes | ||
| // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
| #pragma acc not yet implemented | ||
| while(0) {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| // RUN: %clang_cc1 %s -verify -fopenacc | ||
|
|
||
| // Parser::ParseExternalDeclaration | ||
| // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
| #pragma acc not yet implemented | ||
| int foo; | ||
|
|
||
| struct S { | ||
| // Parser::ParseCXXClassMemberDeclarationWithPragmas | ||
| // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
| #pragma acc not yet implemented | ||
| int foo; | ||
| }; | ||
|
|
||
| void func() { | ||
| // Parser::ParseStmtOrDeclarationAfterAttributes | ||
| // expected-warning@+1{{OpenACC directives not yet implemented, pragma ignored}} | ||
| #pragma acc not yet implemented | ||
| while(false) {} | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| // RUN: %clang_cc1 -E -fopenacc %s | FileCheck %s --check-prefix=DEFAULT | ||
| // RUN: %clang_cc1 -E -fopenacc -fexperimental-openacc-macro-override 202211 %s | FileCheck %s --check-prefix=OVERRIDE | ||
|
|
||
| // DEFAULT: OpenACC:1: | ||
| // OVERRIDE: OpenACC:202211: | ||
| OpenACC:_OPENACC: | ||
|
|
||
| // RUN: %clang_cc1 -E -dM -fopenacc %s | FileCheck %s --check-prefix=MACRO_PRINT_DEF | ||
| // RUN: %clang_cc1 -E -dM -fopenacc -fexperimental-openacc-macro-override 202211 %s | FileCheck %s --check-prefix=MACRO_PRINT_OVR | ||
| // MACRO_PRINT_DEF: #define _OPENACC 1 | ||
| // MACRO_PRINT_OVR: #define _OPENACC 202211 | ||
|
|
||
|
|