1 #include "ns.h" 2 foo()3int foo() 4 { 5 std::printf("global foo()\n"); 6 return 42; 7 } func()8int func() 9 { 10 std::printf("global func()\n"); 11 return 1; 12 } func(int a)13int func(int a) 14 { 15 std::printf("global func(int)\n"); 16 return a + 1; 17 } test_lookup_at_global_scope()18void test_lookup_at_global_scope() 19 { 20 // BP_global_scope 21 std::printf("at global scope: foo() = %d\n", foo()); // eval foo(), exp: 42 22 std::printf("at global scope: func() = %d\n", func()); // eval func(), exp: 1 23 } 24