llvm-project/clang/test/SemaOpenCL/invalid-assignment-constant-address-space.cl
Aaron Ballman 0e890904ea Use functions with prototypes when appropriate; NFC
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);
2022-03-31 13:45:39 -04:00

8 lines
169 B
Common Lisp

// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only
int constant c[3] = {0};
void foo(void) {
c[0] = 1; //expected-error{{read-only variable is not assignable}}
}