void test() {
  foo(10);
  bar<2>();
}
예제 #2
0
// RUN: %clang_cc1 -fsyntax-only -Wall -Wuninitialized -Wno-unused-value -std=c++11 -verify %s

int foo(int x);
int bar(int* x);
int boo(int& x);
int far(const int& x);

// Test self-references within initializers which are guaranteed to be
// uninitialized.
int a = a; // no-warning: used to signal intended lack of initialization.
int b = b + 1; // expected-warning {{variable 'b' is uninitialized when used within its own initialization}}
int c = (c + c); // expected-warning 2 {{variable 'c' is uninitialized when used within its own initialization}}
int e = static_cast<long>(e) + 1; // expected-warning {{variable 'e' is uninitialized when used within its own initialization}}
int f = foo(f); // expected-warning {{variable 'f' is uninitialized when used within its own initialization}}

// Thes don't warn as they don't require the value.
int g = sizeof(g);
void* ptr = &ptr;
int h = bar(&h);
int i = boo(i);
int j = far(j);
int k = __alignof__(k);

int l = k ? l : l;  // expected-warning 2{{variable 'l' is uninitialized when used within its own initialization}}
int m = 1 + (k ? m : m);  // expected-warning 2{{variable 'm' is uninitialized when used within its own initialization}}
int n = -n;  // expected-warning {{variable 'n' is uninitialized when used within its own initialization}}

void test_stuff () {
  int a = a; // no-warning: used to signal intended lack of initialization.
  int b = b + 1; // expected-warning {{variable 'b' is uninitialized when used within its own initialization}}
  int c = (c + c); // expected-warning {{variable 'c' is uninitialized when used within its own initialization}}
예제 #4
0
파일: main.c 프로젝트: AleemDev/waf
int main()
{
	foo();
	return 0;
}
int main(int argc, char **argv) {
#pragma omp target teams distribute simd num_teams // expected-error {{expected '(' after 'num_teams'}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams () // expected-error {{expected expression}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (argc > 0 ? argv[1] : argv[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (argc + argc)
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'num_teams' clause}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (S1) // expected-error {{'S1' does not refer to a value}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (-2) // expected-error {{argument to 'num_teams' clause must be a strictly positive integer value}}
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (-10u)
  for (int i=0; i<100; i++) foo();

#pragma omp target teams distribute simd num_teams (3.14) // expected-error {{expression must have integral or unscoped enumeration type, not 'double'}}
  for (int i=0; i<100; i++) foo();

  return tmain<int, 10>(argc); // expected-note {{in instantiation of function template specialization 'tmain<int, 10>' requested here}}
}
int main (int argc, char* argv[]) {
  foo ();
  bar ();

  return 0;
}
예제 #7
0
int entrypoint()
{
  return foo(16);
}
예제 #8
0
파일: 20100827-1.c 프로젝트: 0day-ci/gcc
int main()
{
  if (foo("a") != 1)
    abort ();
  return 0;
}
예제 #9
0
int main()
{
	int a[3][3]={{1,2,3},{4,5,6},{7,8,9}};
	foo(a);
	printf("%d\n",a[2][1]); 
}
예제 #10
0
파일: friend3.cpp 프로젝트: JaredCJR/clang
void main() {
  foo();
}
예제 #11
0
int main(char argc, char *argv[]) {
    int val = 123;

    foo(1, &val);
}
예제 #12
0
void test_collapse() {
  int i;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expected '('}}
#pragma omp distribute simd collapse
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp distribute simd collapse(
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expected expression}}
#pragma omp distribute simd collapse()
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expected expression}} expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp distribute simd collapse(,
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expected expression}}  expected-error@+1 {{expected ')'}} expected-note@+1 {{to match this '('}}
#pragma omp distribute simd collapse(, )
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-warning@+2 {{extra tokens at the end of '#pragma omp distribute simd' are ignored}}
// expected-error@+1 {{expected '('}}
#pragma omp distribute simd collapse 4)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp distribute simd collapse(4
  for (i = 0; i < 16; ++i)
    ; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
#pragma omp target
#pragma omp teams
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp distribute simd collapse(4,
  for (i = 0; i < 16; ++i)
    ; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
#pragma omp target
#pragma omp teams
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp distribute simd collapse(4, )
  for (i = 0; i < 16; ++i)
    ; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
#pragma omp target
#pragma omp teams
// xxpected-error@+1 {{expected expression}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp distribute simd collapse(4)
  for (i = 0; i < 16; ++i)
    ; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
#pragma omp target
#pragma omp teams
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp distribute simd collapse(4 4)
  for (i = 0; i < 16; ++i)
    ; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
#pragma omp target
#pragma omp teams
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp distribute simd collapse(4, , 4)
  for (i = 0; i < 16; ++i)
    ; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
#pragma omp target
#pragma omp teams
#pragma omp distribute simd collapse(4)
  for (int i1 = 0; i1 < 16; ++i1)
    for (int i2 = 0; i2 < 16; ++i2)
      for (int i3 = 0; i3 < 16; ++i3)
        for (int i4 = 0; i4 < 16; ++i4)
          foo();
#pragma omp target
#pragma omp teams
// expected-error@+2 {{expected ')'}}
// expected-note@+1 {{to match this '('}} expected-note@+1 {{as specified in 'collapse' clause}}
#pragma omp distribute simd collapse(4, 8)
  for (i = 0; i < 16; ++i)
    ; // expected-error {{expected 4 for loops after '#pragma omp distribute simd', but found only 1}}
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
#pragma omp distribute simd collapse(2.5)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{expression is not an integer constant expression}}
#pragma omp distribute simd collapse(foo())
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp distribute simd collapse(-5)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp distribute simd collapse(0)
  for (i = 0; i < 16; ++i)
    ;
#pragma omp target
#pragma omp teams
// expected-error@+1 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp distribute simd collapse(5 - 5)
  for (i = 0; i < 16; ++i)
    ;
// expected-note@+3 {{defined as reduction}}
#pragma omp target
#pragma omp teams
#pragma omp distribute simd collapse(2) reduction(+ : i)
  for (i = 0; i < 16; ++i)
    // expected-note@+1 {{variable with automatic storage duration is predetermined as private; perhaps you forget to enclose 'omp for' directive into a parallel or another task region?}}
    for (int j = 0; j < 16; ++j)
// expected-error@+2 2 {{reduction variable must be shared}}
// expected-error@+1 {{OpenMP constructs may not be nested inside a simd region}}
#pragma omp for reduction(+ : i, j)
      for (int k = 0; k < 16; ++k)
        i += j;

#pragma omp target
#pragma omp teams
  for (i = 0; i < 16; ++i)
    for (int j = 0; j < 16; ++j)
#pragma omp distribute simd reduction(+ : i, j)
      for (int k = 0; k < 16; ++k)
        i += j;
}
예제 #13
0
int main()
{
    foo(bar);  // ok
    // foo(&bar); // error
}
 S2() {
   foo();
 }
int foomain(int argc, char **argv) {
  I e(4);
  I g(5);
  int i;
  int &j = i;                             // expected-note {{'j' defined here}}
#pragma omp parallel sections lastprivate // expected-error {{expected '(' after 'lastprivate'}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate() // expected-error {{expected expression}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argc)
  {
    foo();
  }
#pragma omp parallel sections lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(a, b) // expected-error {{lastprivate variable with incomplete type 'S1'}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argv[1]) // expected-error {{expected variable name}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(e, g) // expected-error 2 {{calling a private constructor of class 'S4'}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(h) // expected-error {{threadprivate or thread local variable cannot be lastprivate}}
  {
    foo();
  }
#pragma omp parallel sections linear(i) // expected-error {{unexpected OpenMP clause 'linear' in directive '#pragma omp parallel sections'}}
  {
    foo();
  }
#pragma omp parallel
  {
    int v = 0;
    int i;
#pragma omp parallel sections lastprivate(i)
    {
      foo();
    }
    v += i;
  }
#pragma omp parallel shared(i)
#pragma omp parallel private(i)
#pragma omp parallel sections lastprivate(j) // expected-error {{arguments of OpenMP clause 'lastprivate' cannot be of reference type}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(i)
  {
    foo();
  }
  return 0;
}
예제 #16
0
template<typename T> void bar (T t) {
	foo(t,typename is_integral<T>::type());
}
예제 #17
0
파일: main.cpp 프로젝트: WhiZTiM/coliru
int main() {
    std::cout << foo().qux << std::endl;
}
예제 #18
0
void
baz ()
{
  foo ();
  bar <0> ();
}
예제 #19
0
static int bar()
{
  return foo(8)+4;
}
T tmain(T argc, S **argv) { //expected-note 2 {{declared here}}
#pragma omp target
#pragma omp teams distribute collapse // expected-error {{expected '(' after 'collapse'}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams distribute collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++)

    argv[0][i] = argv[0][i] - argv[0][i-ST];
#pragma omp target
#pragma omp teams distribute collapse () // expected-error {{expected expression}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

// expected-error@+4 {{expected ')'}} expected-note@+4 {{to match this '('}}
// expected-error@+3 2 {{expression is not an integral constant expression}}
// expected-note@+2 2 {{read of non-const variable 'argc' is not allowed in a constant expression}}
#pragma omp target
#pragma omp teams distribute collapse (argc 
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target
#pragma omp teams distribute collapse (ST // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams distribute collapse (1)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute' are ignored}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams distribute collapse ((ST > 0) ? 1 + ST : 2) // expected-note 2 {{as specified in 'collapse' clause}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST]; // expected-error 2 {{expected 2 for loops after '#pragma omp teams distribute', but found only 1}}

// expected-error@+4 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+3 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
// expected-error@+2 2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute collapse (foobool(argc)), collapse (true), collapse (-5)
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp distribute collapse (S) // expected-error {{'S' does not refer to a value}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

// expected-error@+2 2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams distribute collapse (1)
  for (int i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams distribute collapse (N) // expected-error {{argument to 'collapse' clause must be a strictly positive integer value}}
  for (T i = ST; i < N; i++)
    argv[0][i] = argv[0][i] - argv[0][i-ST];

#pragma omp target
#pragma omp teams distribute collapse (2) // expected-note {{as specified in 'collapse' clause}}
  foo(); // expected-error {{expected 2 for loops after '#pragma omp teams distribute'}}
  return argc;
}
예제 #21
0
파일: test-llvm.c 프로젝트: wujingyue/tests
int main(int argc, char *argv[]) {
	foo("wujingyue");
	return 0;
}
int main(int argc, char **argv) {
#pragma omp target
#pragma omp teams distribute collapse // expected-error {{expected '(' after 'collapse'}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams distribute collapse ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams distribute collapse () // expected-error {{expected expression}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams distribute collapse (4 // expected-error {{expected ')'}} expected-note {{to match this '('}} expected-note {{as specified in 'collapse' clause}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp teams distribute', but found only 1}}

#pragma omp target
#pragma omp teams distribute collapse (2+2)) // expected-warning {{extra tokens at the end of '#pragma omp teams distribute' are ignored}}  expected-note {{as specified in 'collapse' clause}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4]; // expected-error {{expected 4 for loops after '#pragma omp teams distribute', but found only 1}}

#pragma omp target
#pragma omp teams distribute collapse (foobool(1) > 0 ? 1 : 2) // expected-error {{expression is not an integral constant expression}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

// expected-error@+4 {{expression is not an integral constant expression}}
// expected-error@+3 2 {{directive '#pragma omp teams distribute' cannot contain more than one 'collapse' clause}}
// expected-error@+2 2 {{argument to 'collapse' clause must be a strictly positive integer value}}
#pragma omp target
#pragma omp teams distribute collapse (foobool(argc)), collapse (true), collapse (-5) 
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

#pragma omp target
#pragma omp teams distribute collapse (S1) // expected-error {{'S1' does not refer to a value}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

// expected-error@+2 {{expression is not an integral constant expression}}
#pragma omp target
#pragma omp teams distribute collapse (argv[1]=2) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 4; i < 12; i++)
    argv[0][i] = argv[0][i] - argv[0][i-4];

// expected-error@+4 {{statement after '#pragma omp teams distribute' must be a for loop}}
// expected-note@+2 {{in instantiation of function template specialization 'tmain<int, char, -1, -2>' requested here}}
#pragma omp target
#pragma omp teams distribute collapse(collapse(tmain<int, char, -1, -2>(argc, argv) // expected-error 2 {{expected ')'}} expected-note 2 {{to match this '('}}
  foo();

#pragma omp target
#pragma omp teams distribute collapse (2) // expected-note {{as specified in 'collapse' clause}}
  foo(); // expected-error {{expected 2 for loops after '#pragma omp teams distribute'}}

// expected-note@+1 {{in instantiation of function template specialization 'tmain<int, char, 1, 0>' requested here}}
  return tmain<int, char, 1, 0>(argc, argv);
}
T tmain(T argc) {
  char **a;
#pragma omp target teams distribute simd num_teams(C)
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(T) // expected-error {{'T' does not refer to a value}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams // expected-error {{expected '(' after 'num_teams'}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams() // expected-error {{expected expression}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(argc)) // expected-warning {{extra tokens at the end of '#pragma omp target teams distribute simd' are ignored}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(argc > 0 ? a[1] : a[2]) // expected-error {{expression must have integral or unscoped enumeration type, not 'char *'}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(argc + argc)
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(argc), num_teams (argc+1) // expected-error {{directive '#pragma omp target teams distribute simd' cannot contain more than one 'num_teams' clause}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(S1) // expected-error {{'S1' does not refer to a value}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(-2) // expected-error {{argument to 'num_teams' clause must be a strictly positive integer value}}
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(-10u)
  for (int i=0; i<100; i++) foo();
#pragma omp target teams distribute simd num_teams(3.14) // expected-error 2 {{expression must have integral or unscoped enumeration type, not 'double'}}
  for (int i=0; i<100; i++) foo();

  return 0;
}
예제 #24
0
int main()
{
  int x;
  foo(x, &x);
  return 0;
}
예제 #25
0
파일: atomic-16.c 프로젝트: 0day-ci/gcc
int
main ()
{
  int v, *p;
  p = &x;
  #pragma omp atomic update
    p[foo (), 0] = 16 + 6 - p[foo (), 0];
  #pragma omp atomic read
    v = x;
  if (cnt != 2 || v != 16)
    abort ();
  #pragma omp atomic capture
    v = p[foo () + foo (), 0] = p[foo () + foo (), 0] + 3;
  if (cnt != 6 || v != 19)
    abort ();
  #pragma omp atomic capture
    v = p[foo (), 0] = 12 * 1 / 2 + (foo (), 0) + p[foo (), 0];
  if (cnt != 9 || v != 25)
    abort ();
  #pragma omp atomic capture
    {
      v = p[foo () & 0]; p[foo () & 0] = (foo (), 1) * 9 - p[foo () & 0];
    }
  if (cnt != 13 || v != 25)
    abort ();
  #pragma omp atomic read
    v = x;
  if (v != -16)
    abort ();
  #pragma omp atomic capture
    {
      p[0 & foo ()] = 16 - 2 + 3 + p[0 & foo ()]; v = p[0 & foo ()];
    }
  if (cnt != 16 || v != 1)
    abort ();
  #pragma omp atomic capture
    {
      v = p[foo (), 0]; p[foo (), 0] = (foo (), 7) ? 13 : foo () + 6;
    }
  if (cnt != 19 || v != 1)
    abort ();
  #pragma omp atomic read
    v = x;
  if (v != 13)
    abort ();
  return 0;
}
예제 #26
0
파일: foo.c 프로젝트: Andreiphontes/CMake
  void bar()
{
  foo();
}
예제 #27
0
파일: no-wchar.cpp 프로젝트: 4ntoine/clang
void bar() {
  foo(L"wide string literal");
}
int main(int argc, char **argv) {
  const int d = 5;       // expected-note {{constant variable is predetermined as shared}}
  const int da[5] = {0}; // expected-note {{constant variable is predetermined as shared}}
  S4 e(4);
  S5 g(5);
  S3 m;
  S6 n(2);
  int i;
  int &j = i;                             // expected-note {{'j' defined here}}
#pragma omp parallel sections lastprivate // expected-error {{expected '(' after 'lastprivate'}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate() // expected-error {{expected expression}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argc, // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argc > 0 ? argv[1] : argv[2]) // expected-error {{expected variable name}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argc)
  {
    foo();
  }
#pragma omp parallel sections lastprivate(S1) // expected-error {{'S1' does not refer to a value}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(a, b, c, d, f) // expected-error {{lastprivate variable with incomplete type 'S1'}} expected-error 3 {{shared variable cannot be lastprivate}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(argv[1]) // expected-error {{expected variable name}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(2 * 2) // expected-error {{expected variable name}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(ba)
  {
    foo();
  }
#pragma omp parallel sections lastprivate(ca) // expected-error {{shared variable cannot be lastprivate}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(da) // expected-error {{shared variable cannot be lastprivate}}
  {
    foo();
  }
  int xa;
#pragma omp parallel sections lastprivate(xa) // OK
  {
    foo();
  }
#pragma omp parallel sections lastprivate(S2::S2s)
  {
    foo();
  }
#pragma omp parallel sections lastprivate(S2::S2sc) // expected-error {{shared variable cannot be lastprivate}}
  {
    foo();
  }
#pragma omp parallel sections safelen(5) // expected-error {{unexpected OpenMP clause 'safelen' in directive '#pragma omp parallel sections'}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(e, g) // expected-error {{calling a private constructor of class 'S4'}} expected-error {{calling a private constructor of class 'S5'}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(h, B::x) // expected-error 2 {{threadprivate or thread local variable cannot be lastprivate}}
  {
    foo();
  }
#pragma omp parallel sections private(xa), lastprivate(xa) // expected-error {{private variable cannot be lastprivate}} expected-note {{defined as private}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(i)
  {
    foo();
  }
#pragma omp parallel private(xa)
#pragma omp parallel sections lastprivate(xa)
  {
    foo();
  }
#pragma omp parallel reduction(+ : xa)
#pragma omp parallel sections lastprivate(xa)
  {
    foo();
  }
#pragma omp parallel sections lastprivate(j) // expected-error {{arguments of OpenMP clause 'lastprivate' cannot be of reference type}}
  {
    foo();
  }
#pragma omp parallel sections firstprivate(m) lastprivate(m) // expected-error {{'operator=' is a private member of 'S3'}}
  {
    foo();
  }
#pragma omp parallel sections lastprivate(n) firstprivate(n) // OK
  {
    foo();
  }
  return foomain<S4, S5>(argc, argv); // expected-note {{in instantiation of function template specialization 'foomain<S4, S5>' requested here}}
}
예제 #29
0
파일: delete2.C 프로젝트: pjump/gcc
void bar()
{
    A n;
    n = foo();		// { dg-bogus "" } deleting const
}
int main(int argc, char **argv) {
  #pragma omp taskloop simd num_tasks // expected-error {{expected '(' after 'num_tasks'}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks ( // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks () // expected-error {{expected expression}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks (argc // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks (argc)) // expected-warning {{extra tokens at the end of '#pragma omp taskloop simd' are ignored}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks (argc > 0 ? argv[1][0] : argv[2][argc])
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks (foobool(argc)), num_tasks (true) // expected-error {{directive '#pragma omp taskloop simd' cannot contain more than one 'num_tasks' clause}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks (S1) // expected-error {{'S1' does not refer to a value}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks (argc argc) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks (1 0) // expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks(if(tmain(argc, argv) // expected-error {{expected expression}} expected-error {{expected ')'}} expected-note {{to match this '('}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks(0)  // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks(-1) // expected-error {{argument to 'num_tasks' clause must be a strictly positive integer value}}
  for (int i = 0; i < 10; ++i)
    foo();
  #pragma omp taskloop simd num_tasks(argc) grainsize(argc) // expected-error {{'grainsize' and 'num_tasks' clause are mutually exclusive and may not appear on the same directive}} expected-note {{'num_tasks' clause is specified here}}
  for (int i = 0; i < 10; ++i)
    foo();

  return tmain(argc, argv);
}