Debian Codegraph @

gcc/testsuite/gnat.dg/atomic9.adb

raw
1 -- { dg-do compile }
2 -- { dg-options "-fdump-tree-gimple" }
3
4 with Interfaces;
5
6 procedure Atomic9 is
7
8 Register : Interfaces.Unsigned_32;
9
10 type Interrupt_ID is range 0 .. 44;
11
12 procedure Trigger_Interrupt (IRQ : Interrupt_ID) is
13 NVIC_STIR : Interrupt_ID
14 with
15 Import,
16 Atomic,
17 Size => 32,
18 Address => Register'Address;
19
20 begin
21 NVIC_STIR := IRQ;
22 end Trigger_Interrupt;
23
24 begin
25 Register := 16#ffff_ffff#;
26 Trigger_Interrupt (1);
27 end;
28
29 -- { dg-final { scan-tree-dump "atomic_store_4" "gimple" } }