void main() { printf("hhello world!\n"); foo1(); foo2(); foo1(); printf("GO PRAGUE\n"); }
int test1() { int i = 19; foo1(i); SHOW(i); foo1<int&>(i); SHOW(i); foo1(42); }
int main() { printf("%d\n", foo1()); printf("%d\n", 5*foo1() + foo1()); printf("%s", foo2()); printf("%s", foo3()); if (foo4()) { printf("Yes\n"); } }
main() { char data[2][10]; int i; init(data); for (i = 0; i < 10; i++) { foo1(data, 1, i); foo1(data, 0, i); } }
main() { printf("this is change!"); foo1(); foo2(); foo1(); printf("hello! bug123~~~~~^^"); printf("hi"); }
int64_t foo1(uint32_t n) { if(n == 0) { return 0; } else if (n == 1) { return 1; } return foo1(n - 1) + foo1(n - 2); }
int main( void ) { foo1( 1 ); foo1( 2 ); foo1( 3 ); foo2( 1 ); foo2( 2 ); foo2( 3 ); for( int i = 0; i < 6; ++ i ) { millerTime( i ); printf( "\n" ); } return 0; }
int main() { foo1(1.2); // OK, calls the first version of foo1() foo1(10); // OK, calls the second version of foo1() // foo2(0.1); // compile-time error foo2(7); // OK // foo3(1.2); // compile-time error foo3(34); // OK // A<int> a1; // compile-time error A<double> a1; // OK }
int main() { foo1(1.2); // OK, calls the first version of foo1() foo1(10); // OK, calls the second version of foo1() // foo2(0.1); // compile-time error foo2(7); // OK // foo3(1.2); // compile-time error foo3(34); // OK A<int> a1; // OK, matches the primary template A<double> a2; // OK, matches the partial specialization }
int main(int argc, char *argv[]) { int x = 27; const int cx = x; const int& rx = x; // Case 1: The template parameter type is a Reference or a Pointer, but // not an Universal reference. // Even if T is not const, if the passed parameter is const it has to be // enforced upon the "foo" function to ensure the constness. foo1(x); // T is int, param is int& foo1(cx); // T is int, param is const int& foo1(rx); // T is int, param is const int& // The T type in foo2 is const, so the constness has to be enforced for any // given parameter type. foo2(x); // T is int, param is const int& foo2(cx); // T is int, param is const int& foo2(rx); // T is int, param is const int& // Case 2: The template parameter type is an Universal reference. // If the passed parameter is an lvalue, both T and param will be lvalue // references. Otherwise, the rules described in "Case 1" apply. foo3(x); // T is int&, param is int& foo3(cx); // T is const int&, param is const int& foo3(rx); // T is const int&, param is const int& foo3(27); // T is int, param is int&& // Case 3: The template parameter type is neither a Reference nor a Pointer. // We're passing by value: references, const and volatile will be ignored. foo4(x); // T is int, param is int foo4(cx); // T is int, param is int foo4(rx); // T is int, param is int // Pointers and C-style arrays have the same logic as before when deducing // their types. // Oh, by the way, did you know that you can pass C arrays by reference? :P int numbers[] = { 1, 2, 3, 4, 5 }; std::cout << arraySize(numbers) << std::endl; }
void pascal_main() { ia = b; ia = a1[boost::make_tuple(1)]; ib = ia + b; ic = pow(ia, b); ia = ia * ib; ia = ia / k; ia = ia && b; ia = ia || b; ia = !b; if (ia == ib) foo(); if (ia == ib) foo(); else foo1(); ia = ib; for (ia = b; ia <= b; --ia) foo(); while (ia == b) foo(); ia = b; do { foo(); } while (foo1); while (foo1) { foo(); } ; }
int main () { struct T b; foo (3, b); foo1 (3, b); return 0; }
int main (void) { int i; check_vect (); for (i=0; i<N; i++) { X[i] = 16-i; uX[i] = 16-i; } foo1 (N); for (i=0; i<N; i++) { if (uresult[i] != (unsigned int)uX[i]) abort (); } foo2 (N); for (i=0; i<N; i++) { if (result[i] != (int)X[i]) abort (); } return 0; }
int main(int argc, char *argv[]) { int a[10] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9}; foo1(a); #pragma omp taskwait if (a[0] != 3) abort(); a[0] = 0; foo2(a); #pragma omp taskwait if (a[0] != 3) abort(); a[0] = 0; foo3(a); #pragma omp taskwait if (a[3] != 13 || a[4] != 48) abort(); a[3] = 3; a[4] = 4; foo4(a); #pragma omp taskwait if (a[3] != 13 || a[4] != 48) abort(); return 0; }
int foo (char *ptr) { char *tmp = 0; foo1 (&ptr); tmp = ptr; return tmp[0] + tmp[4]; }
void testTortureExecute (void) { if (foo1() != foo2()) ASSERT (0); return; }
void t (int x, int y) { if (y < 5) foo1 (120); else foo2 (120); }
int main (void) { foo1 (); foo2 (); return 0; }
int foo2 (void) { union un u; u.i = 1; return foo1 (u) + bar1 (u); }
int main () { foo1(1, NULL); // OK foo1(1, 0) ; // expected-warning {{missing sentinel in function call}} foo5(1, NULL, 2); // OK foo5(1,2,NULL, 1); // OK foo5(1, NULL, 2, 1); // expected-warning {{missing sentinel in function call}} foo6(1,2,3,4,5,6,7); // expected-warning {{missing sentinel in function call}} foo6(1,NULL,3,4,5,6,7); // OK foo7(1); // expected-warning {{not enough variable arguments in 'foo7' declaration to fit a sentinel}} foo7(1, NULL); // OK foo12(1); // expected-warning {{not enough variable arguments in 'foo12' declaration to fit a sentinel}} }
int main() { foo1(); foo2(); foo3(); foo4(); }
int main (void) { int i, dot1, dot3; short dot2; check_vect (); for (i=0; i<N; i++) { X[i] = i; Y[i] = 64-i; } dot1 = foo1 (N); if (dot1 != DOT1) abort (); dot2 = foo2 (N); if (dot2 != DOT2) abort (); dot3 = foo3 (N); if (dot3 != DOT3) abort (); return 0; }
int main(int argc, char* argv[]) { foo1((int)1); foo1(false); foo2<int>(1.0f); foo2<short>(10); foo3<int>(1.0f, 1.0); foo3<short>((int)1, (char)1); std::string s("42"); clear(s); BOOST_TEST(s.empty()); return boost::report_errors(); }
int main() { A a; foo1(a); foo2(a); printf ("PASS\n"); }
int main() { int i = foo1(); if (i == 42) return 0; else return 1; }
int main () { if (foo1 () == 0 && foo2 () == 0 && foo3 () == 0) printf ("PASS\n"); return 0; }
int main (void) { if (foo1 (10) != 3) abort (); if (foo2 (10) != 3) abort (); exit (0); }
void doo(Params const& params) { char const* nm; if( params.has(name) ) nm = params[name]; else nm = "abc"; foo1( nm, params[value], params.has(index) ? params[index] : 0 ); }
TEST(about_arrays, passing_arrays) { char a[] = "om"; foo1(a); foo2(a); foo3(a); foo4(a); foo5(&a); }
void bar() { // CHECK: FunctionDecl {{.*}} <line:{{.*}}, line:{{.*}}> bar 'void ()' foo1(0); // CHECK: ImplicitCastExpr {{.*}} <col:{{.*}}> 'void *' <NullToPointer> foo2(0); // CHECK: ImplicitCastExpr {{.*}} <col:{{.*}}> 'void *' <NullToPointer> }