Skip to content

Commit

Permalink
Testcase for new support for &
Browse files Browse the repository at this point in the history
  • Loading branch information
mwhicks1 committed May 6, 2020
1 parent 2157911 commit a820a89
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions clang/test/CheckedCRewriter/amper.c
Original file line number Diff line number Diff line change
@@ -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<int*> y = &x;

void bar(int *x) {
x = (int *)5;
int *y = *(&x);
}

int f(int *x) {
return *x;
}
//CHECK: int f(_Ptr<int> x) {

void baz(void) {
int (*fp)(int *) = f;
int (*fp2)(int *) = &f;
f((void*)0);
}
//CHECK: _Ptr<int (_Ptr<int> )> fp = f;
//CHECK: _Ptr<int (_Ptr<int> )> fp2 = &f;

0 comments on commit a820a89

Please sign in to comment.