2009-01-12 05:23:27 +08:00
|
|
|
// RUN: clang -emit-llvm %s -o %t -arch=i386
|
|
|
|
void t1(int len)
|
2009-01-12 03:46:50 +08:00
|
|
|
{
|
2009-01-12 05:23:27 +08:00
|
|
|
__asm__ volatile("" : "=&r"(len), "+&r"(len));
|
2009-01-12 03:46:50 +08:00
|
|
|
}
|
2009-01-12 05:23:27 +08:00
|
|
|
|
|
|
|
void t2(unsigned long long t)
|
|
|
|
{
|
|
|
|
__asm__ volatile("" : "+m"(t));
|
|
|
|
}
|
|
|
|
|
|
|
|
void t3(unsigned char *src, unsigned long long temp)
|
|
|
|
{
|
|
|
|
__asm__ volatile("" : "+m"(temp), "+r"(src));
|
|
|
|
}
|
|
|
|
|
2009-01-12 10:22:13 +08:00
|
|
|
void t4()
|
|
|
|
{
|
|
|
|
unsigned long long a;
|
|
|
|
struct reg { unsigned long long a, b; } b;
|
|
|
|
|
|
|
|
__asm__ volatile ("":: "m"(a), "m"(b));
|
|
|
|
}
|
2009-01-12 05:23:27 +08:00
|
|
|
|
2009-01-28 04:38:24 +08:00
|
|
|
// PR3417
|
|
|
|
void t5(int i)
|
|
|
|
{
|
|
|
|
asm("nop" : "=r"(i) : "0"(t5));
|
|
|
|
}
|
2009-02-22 10:11:23 +08:00
|
|
|
|
|
|
|
// PR3641
|
|
|
|
void t6(void)
|
|
|
|
{
|
|
|
|
__asm__ volatile("" : : "i" (t6));
|
|
|
|
}
|