Commit 76546497 authored by Christian Dietrich's avatar Christian Dietrich
Browse files

Add Testcases

parent 3b6ef3e0
struct raw_spin_lock {
int counter;
};
// CPPSIG: void raw_spin_unlock(struct raw_spin_lock * lock)
#define raw_spin_unlock(lock) _raw_spin_unlock(lock)
// CPPSIG: void _raw_spin_unlock(struct raw_spin_lock * lock)
#define _raw_spin_unlock(lock) __raw_spin_unlock(lock)
void __raw_spin_unlock(struct raw_spin_lock *lock);
#define DEF(a) \
void a(void) { \
struct raw_spin_lock O; \
raw_spin_unlock(&O); \
}
#define foo_foo_bar 1
#define foo_bar_bar 0
DEF(bar)
DEF(foo)
struct raw_spin_lock {
int counter;
};
// CPPSIG: void raw_spin_unlock(struct raw_spin_lock * lock)
#define raw_spin_unlock(lock) _raw_spin_unlock(lock)
// CPPSIG: void _raw_spin_unlock(struct raw_spin_lock * lock)
#define _raw_spin_unlock(lock) __raw_spin_unlock(lock)
void __raw_spin_unlock(struct raw_spin_lock *lock);
#define DEF(a) \
void a(void) { \
struct raw_spin_lock O; \
if (foo_##a##_bar) return;\
raw_spin_unlock(&O); \
}
#define foo_foo_bar 1
#define foo_bar_bar 0
DEF(bar)
DEF(foo)
struct raw_spin_lock {
int counter;
};
struct spinlock {
struct raw_spin_lock rlock;
};
// CPPSIG: void raw_spin_unlock(struct raw_spin_lock * lock, unsigned long flags)
#define raw_spin_unlock(lock,flags) ({ \
_raw_spin_unlock(lock,flags); \
})
// CPPSIG: void _raw_spin_unlock(struct raw_spin_lock * lock, unsigned long flags)
#define _raw_spin_unlock(lock,flags) ({ \
typecheck(unsigned long, flags); \
__raw_spin_unlock(lock,flags); \
})
void __raw_spin_unlock(struct raw_spin_lock *lock, unsigned long flags);
#define typecheck(type,x) \
({ type __dummy; \
typeof(x) __dummy2; \
(void)(&__dummy == &__dummy2); \
1; \
})
#define spin_lock_unlock(S,flags) \
do { \
raw_spin_unlock(spinlock_check(S),flags); \
} while (0)
struct raw_spin_lock *spinlock_check(struct spinlock *S) {
return &(S->rlock);
}
void foo(void) {
struct spinlock O;
spin_lock_unlock(&O,3UL);
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment