This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In principle this might be valid, but stick to ints and floats for scalar
// types at the moment.
sum+=__builtin_arm_ldaex((structSimple*)addr).a; // expected-error {{address argument to atomic builtin must be a pointer to}}
sum+=__builtin_arm_ldaex((__int128*)addr); // expected-error {{__int128 is not supported on this target}} expected-error {{address argument to load or store exclusive builtin must be a pointer to 1,2,4 or 8 byte type}}
__builtin_arm_ldaex(); // expected-error {{too few arguments to function call}}
__builtin_arm_ldaex(1, 2); // expected-error {{too many arguments to function call}}
returnsum;
}
inttest_stlex(char*addr) {
intres=0;
structSimplevar= {0};
res |= __builtin_arm_stlex(4, addr);
res |= __builtin_arm_stlex(42, (short*)addr);
res |= __builtin_arm_stlex(42, (int*)addr);
res |= __builtin_arm_stlex(42, (long long*)addr);
res |= __builtin_arm_stlex(2.71828f, (float*)addr);
res |= __builtin_arm_stlex(3.14159, (double*)addr);
res |= __builtin_arm_stlex(&var, (structSimple**)addr);
res |= __builtin_arm_stlex(42, (volatilechar*)addr);
res |= __builtin_arm_stlex(42, (char*const)addr);
res |= __builtin_arm_stlex(42, (constchar*)addr); // expected-warning {{passing 'const char *' to parameter of type 'volatile char *' discards qualifiers}}
res |= __builtin_arm_stlex(var, (structSimple*)addr); // expected-error {{address argument to atomic builtin must be a pointer to}}
res |= __builtin_arm_stlex(var, (structSimple**)addr); // expected-error {{passing 'struct Simple' to parameter of incompatible type 'struct Simple *'}}
res |= __builtin_arm_stlex(&var, (structSimple**)addr).a; // expected-error {{is not a structure or union}}
res |= __builtin_arm_stlex(1, (__int128*)addr); // expected-error {{__int128 is not supported on this target}} expected-error {{address argument to load or store exclusive builtin must be a pointer to 1,2,4 or 8 byte type}}
__builtin_arm_stlex(1); // expected-error {{too few arguments to function call}}
__builtin_arm_stlex(1, 2, 3); // expected-error {{too many arguments to function call}}
returnres;
}
voidtest_clrex() {
__builtin_arm_clrex();
__builtin_arm_clrex(1); // expected-error {{too many arguments to function call}}
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// In principle this might be valid, but stick to ints and floats for scalar
// types at the moment.
sum+=__builtin_arm_ldaex((structSimple*)addr).a; // expected-error {{address argument to atomic builtin must be a pointer to}}
__builtin_arm_ldaex(); // expected-error {{too few arguments to function call}}
__builtin_arm_ldaex(1, 2); // expected-error {{too many arguments to function call}}
returnsum;
}
inttest_stlex(char*addr) {
intres=0;
structSimplevar= {0};
res |= __builtin_arm_stlex(4, addr);
res |= __builtin_arm_stlex(42, (short*)addr);
res |= __builtin_arm_stlex(42, (int*)addr);
res |= __builtin_arm_stlex(42, (long long*)addr);
res |= __builtin_arm_stlex(42, (__int128*)addr);
res |= __builtin_arm_stlex(2.71828f, (float*)addr);
res |= __builtin_arm_stlex(3.14159, (double*)addr);
res |= __builtin_arm_stlex(&var, (structSimple**)addr);
res |= __builtin_arm_stlex(42, (volatilechar*)addr);
res |= __builtin_arm_stlex(42, (char*const)addr);
res |= __builtin_arm_stlex(42, (constchar*)addr); // expected-warning {{passing 'const char *' to parameter of type 'volatile char *' discards qualifiers}}
res |= __builtin_arm_stlex(var, (structSimple*)addr); // expected-error {{address argument to atomic builtin must be a pointer to}}
res |= __builtin_arm_stlex(var, (structSimple**)addr); // expected-error {{passing 'struct Simple' to parameter of incompatible type 'struct Simple *'}}
res |= __builtin_arm_stlex(&var, (structSimple**)addr).a; // expected-error {{is not a structure or union}}
__builtin_arm_stlex(1); // expected-error {{too few arguments to function call}}
__builtin_arm_stlex(1, 2, 3); // expected-error {{too many arguments to function call}}
returnres;
}
voidtest_clrex() {
__builtin_arm_clrex();
__builtin_arm_clrex(1); // expected-error {{too many arguments to function call}}