// CHECK-LABEL: define void @_ZN7Elision5test0Ev() void test0() { // CHECK: [[I:%.*]] = alloca [[A:%.*]], align 8 // CHECK-NEXT: [[J:%.*]] = alloca [[A]], align 8 // CHECK-NEXT: [[T0:%.*]] = alloca [[A]], align 8 // CHECK-NEXT: [[K:%.*]] = alloca [[A]], align 8 // CHECK-NEXT: [[T1:%.*]] = alloca [[A]], align 8 // CHECK-NEXT: call void @_ZN7Elision3fooEv() // CHECK-NEXT: call void @_ZN7Elision1AC1Ev([[A]]* [[I]]) A i = (foo(), A()); // CHECK-NEXT: call void @_ZN7Elision4fooAEv([[A]]* sret [[T0]]) // CHECK-NEXT: call void @_ZN7Elision1AC1Ev([[A]]* [[J]]) // CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[T0]]) A j = (fooA(), A()); // CHECK-NEXT: call void @_ZN7Elision1AC1Ev([[A]]* [[T1]]) // CHECK-NEXT: call void @_ZN7Elision4fooAEv([[A]]* sret [[K]]) // CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[T1]]) A k = (A(), fooA()); // CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[K]]) // CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[J]]) // CHECK-NEXT: call void @_ZN7Elision1AD1Ev([[A]]* [[I]]) }
/** * Declare an int and output information relating to * it and a pointer to it. */ int main(){ /*declare an integer x*/ int x = 2; /*print the address of x*/ printf("%p\n", &x); /*Call fooA() with the address of x*/ fooA(&x); /*print the value of x*/ printf("%d\n", x); return 0; }
int main() { /*declare an integer x*/ int x = 10; /*print the address of x*/ printf ("Address of x: %p \n" , &x); /*Call fooA() with the address of x*/ fooA(&x); /*print the value of x*/ printf("Value of x is: %d", x); return 0; }
int main(){ int x = 0; // initializes x printf("\n address of x: %p", &x); //prints the address of x fooA(&x); //calls fooA with the address of x; printf("\n value of x: %d\n", x); // prints the value of x; return 0; }
int main(){ /*declare an integer x*/ int x = 10; int *ptr; ptr = &x; /*print the address of x*/ printf("The address of x: %p\n", &x); /*Call fooA() with the address of x*/ fooA(ptr); /*print the value of x*/ printf("The value of x: %d\n", x); return 0; }
int main(){ /*Declare an integer x*/ int x = 305; /*Print the address of x*/ printf("The Address pointed to by x: %p\n", &x); /*Call fooA() with the address of x*/ fooA(&x); /*Print the value of x*/ printf("The value of x is: %d\n", x); return 0; }
int main(){ const int VALUE = 10; /*declare an integer x*/ int x=VALUE; /*print the address of x*/ printf("%x\n", &x); //todo print in int or hex? /*Call fooA() with the address of x*/ fooA(&x); /*print the value of x*/ printf("%d\n",x); return 0; }