mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 06:56:06 +00:00

A significant number of our tests in C accidentally use functions without prototypes. This patch converts the function signatures to have a prototype for the situations where the test is not specific to K&R C declarations. e.g., void func(); becomes void func(void); This is the fifth batch of tests being updated (there are a significant number of other tests left to be updated). Note, the behavior of -ast-print is broken. It prints functions with a prototype (void) as if they have no prototype () in C. Some tests need to disable strict prototype checking when recompiling the results of an -ast-print invocation.
19 lines
1.4 KiB
C
19 lines
1.4 KiB
C
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify %s
|
|
// RUN: %clang_cc1 -triple x86_64-unknown-unknown -fopenmp -verify %s -x c++
|
|
|
|
int dummy(void) { return 1; }
|
|
|
|
#pragma omp declare variant(dummy) match(implementation={extension(match_any,match_all)}, device={kind(cpu, gpu)}) // expected-error {{only a single match extension allowed per OpenMP context selector}} expected-note {{the previous context property 'match_any' used here}} // expected-note {{the ignored property spans until here}}
|
|
int base1(void) { return 2; }
|
|
|
|
#pragma omp declare variant(dummy) match(implementation={extension(match_none,match_none)}, device={kind(gpu, fpga)}) // expected-warning {{the context property 'match_none' was used already in the same 'omp declare variant' directive; property ignored}} expected-note {{the previous context property 'match_none' used here}} expected-note {{the ignored property spans until here}}
|
|
int base2(void) { return 3; }
|
|
|
|
#pragma omp declare variant(dummy) match(implementation={vendor(pgi), extension(match_none,match_any)}, device={kind(cpu, gpu)}) // expected-error {{only a single match extension allowed per OpenMP context selector}} expected-note {{the previous context property 'match_none' used here}} // expected-note {{the ignored property spans until here}}
|
|
int base3(void) { return 4; }
|
|
|
|
|
|
int test(void) {
|
|
return base1() + base2() + base3();
|
|
}
|