diff --git a/clang/test/CheckedCRewriter/amper.c b/clang/test/CheckedCRewriter/amper.c new file mode 100644 index 000000000000..0af8bc663a57 --- /dev/null +++ b/clang/test/CheckedCRewriter/amper.c @@ -0,0 +1,25 @@ +// RUN: cconv-standalone %s -- | FileCheck -match-full-lines %s + +void foo(int *x) { + x = (int *)5; + int **y = &x; +} +//CHECK: _Ptr y = &x; + +void bar(int *x) { + x = (int *)5; + int *y = *(&x); +} + +int f(int *x) { + return *x; +} +//CHECK: int f(_Ptr x) { + +void baz(void) { + int (*fp)(int *) = f; + int (*fp2)(int *) = &f; + f((void*)0); +} +//CHECK: _Ptr )> fp = f; +//CHECK: _Ptr )> fp2 = &f;