blob: 6a639f8047db395f7239648a42938d3b22dec09a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
// RUN: %clangxx -g %s -o %t && %run %t
#include <assert.h>
#include <stdio.h>
int main(int argc, char **argv) {
FILE *fp = fopen(argv[0], "r");
assert(fp);
char buf[2];
char *s = fgets(buf, sizeof(buf), fp);
assert(s);
assert(!fclose(fp));
return 0;
}
|