Debian Codegraph @

gcc/testsuite/c-c++-common/toplevel-asm-1.c

raw
1 /* PR c/41045 */
2 /* { dg-do compile } */
3 /* { dg-options "-O0" } */
4 /* { dg-additional-options "-fno-pie" { target pie } } */
5
6 struct S { char a; long long b; int c; };
7 enum E { E0, E1 = sizeof (struct S) + 15 };
8 int v[42];
9 void foo (void) {}
10
11 /* Not all targets can use %cN even in non-pic code. */
12 #if defined(__riscv) || defined(__loongarch__)
13 asm ("# %0 %1 %2 %cc3 %cc4 %5 %% %="
14 #else
15 asm ("# %0 %1 %2 %c3 %c4 %5 %% %="
16 #endif
17 :: "i" (sizeof (struct S)),
18 "i" (__builtin_offsetof (struct S, c)),
19 "i" (E1),
20 "s" (foo),
21 "i" (v),
22 /* Not all targets can satisfy "m" even in non-pic code. */
23 #if !defined(__i386__) && !defined(__x86_64__)
24 "s" (v));
25 #else
26 "m" (v));
27 asm ("# %0 %1"
28 : "=m" (v[16])
29 : "m" (v[41]));
30 #endif