[RISCV] Add RVVConstraint to SiFive custom matrix multiply instructions. (#124055)
[llvm-project.git] / compiler-rt / test / sanitizer_common / TestCases / Posix / fgetc_ungetc_getc.cpp
blobf895cf194ce7c7258464c895a9fa861770daca3a
1 // RUN: %clangxx -g %s -o %t && %run %t
3 #include <assert.h>
4 #include <stdio.h>
6 int main(int argc, char **argv) {
7 FILE *fp = fopen(argv[0], "r");
8 assert(fp);
10 // the file should be at least one character long, always
11 assert(fgetc(fp) != EOF);
12 // POSIX guarantees being able to ungetc() at least one character
13 assert(ungetc('X', fp) != EOF);
14 // check whether ungetc() worked
15 assert(getc(fp) == 'X');
17 assert(!fclose(fp));
18 return 0;