brintos

brintos / llvm-project-archived public Read only

0
0
Text · 429 B · 15e7575 Raw
24 lines · cpp
1#include "ns.h"2 3int foo()4{5  std::printf("global foo()\n");6  return 42;7}8int func()9{10  std::printf("global func()\n");11  return 1;12}13int func(int a)14{15  std::printf("global func(int)\n");16  return a + 1;17}18void test_lookup_at_global_scope()19{20  // BP_global_scope21  std::printf("at global scope: foo() = %d\n", foo()); // eval foo(), exp: 4222  std::printf("at global scope: func() = %d\n", func()); // eval func(), exp: 123}24