aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/issue1252/pkg.vhdl
blob: 42a24fdc432d4a83be8f92049cdb99e876c586c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package pkg is
	type c_int_prot is protected
		impure function get return integer;
		--------------------------------------------
		impure function c_getInt return integer;
		attribute foreign of c_getInt : function is "VHPIDIRECT getInt";
		--------------------------------------------
	end protected c_int_prot;
	--------------------------------------------
	-- impure function c_getInt return integer;
	-- attribute foreign of c_getInt : function is "VHPIDIRECT getInt";
	--------------------------------------------

	shared variable c_int : c_int_prot;
end package;

package body pkg is
	type c_int_prot is protected body
		variable hidden_c_int : integer := c_getInt;

		impure function get return integer is
		begin
			return hidden_c_int;
		end function;

		--------------------------------------------
		impure function c_getInt return integer is
		begin
			assert false report "c_getInt VHPIDIRECT" severity failure;
		end function;
		--------------------------------------------
	end protected body c_int_prot;
	--------------------------------------------
	-- impure function c_getInt return integer is
	-- begin
	-- 	assert false report "c_getInt VHPIDIRECT" severity failure;
	-- end function;
	--------------------------------------------
end package body;