1/* Test than @encode is properly instantiated. */
2/* { dg-options "-lobjc" } */
3/* { dg-do run } */
4
5#include <string.h>
6#include <stdlib.h>
7#include <objc/objc.h>
8
9template<typename T>
10class typeOf {
11public:
12    operator const char*() { return @encode(T); }
13};
14
15int main() {
16    typeOf<int> t;
17    if (strcmp ((const char *)t, @encode(int)))
18      abort();
19
20    typeOf<const char*> c;
21    if (strcmp ((const char *)c, @encode(const char*)))
22      abort();
23
24    return 0;
25}
26
27