int test_staticlink() { char *ptr = "Hello world!"; char *np = 0; int i = 5; unsigned int bs = sizeof(int)*8; int mi; char buf[80]; int a = 0; a = test_global(); // gI = 100 printf("global variable gI = %d", a); if (a == 100) printf(", PASS\n"); else printf(", FAIL\n"); a = select_1(); printf("select_1() = %d\n", a); // a = 1 a = select_2(); printf("select_2() = %d\n", a); // a = 1 a = select_3(); printf("select_3() = %d\n", a); // a = 1 a = test_select_global_pic(); // test global of pic llc -O1 option printf("test_select_global_pic() = %d", a); // a = 100 if (a == 100) printf(", PASS\n"); else printf(", FAIL\n"); a = test_func_arg_struct(); a = test_contructor(); a = test_template(); printf("test_template() = %d", a); // a = 15 if (a == 15) printf(", PASS\n"); else printf(", FAIL\n"); a = test_alloc(); // 31 printf("test_alloc() = %d", a); if (a == 31) printf(", PASS\n"); else printf(", FAIL\n"); a = test_inlineasm(); printf("test_inlineasm() = %d", a); // a = 53 if (a == 53) printf(", PASS\n"); else printf(", FAIL\n"); return 0; }
// given a pos in RevTrie, get the corresponding RevTrie node trieNode getnodeRevTrie(revtrie T, uint pos) { return select_0(T->pdata->bdata, select_1(T->B,pos+1)+1); }
inline const T& clamp_unordered(const T& x, const T& min, const T& max) { return select_1(min, x, max, adobe::less()); }
inline const T& clamp_unordered(const T& x, const T& min, const T& max, R r) { return select_1(min, x, max, r); }