comparison gcc/testsuite/g++.dg/plugin/pragma_plugin.c @ 131:84e7813d76e9

gcc-8.2
author mir3636
date Thu, 25 Oct 2018 07:37:49 +0900
parents 04ced10e8804
children
comparison
equal deleted inserted replaced
111:04ced10e8804 131:84e7813d76e9
31 warning (OPT_Wpragmas, "%<#pragma GCCPLUGIN sayhello%> is not a string"); 31 warning (OPT_Wpragmas, "%<#pragma GCCPLUGIN sayhello%> is not a string");
32 return; 32 return;
33 } 33 }
34 if (TREE_STRING_LENGTH (message) > 1) 34 if (TREE_STRING_LENGTH (message) > 1)
35 { 35 {
36 location_t loc = expansion_point_location (input_location);
36 if (cfun) 37 if (cfun)
37 warning (OPT_Wpragmas, 38 warning_at (loc, OPT_Wpragmas,
38 "%<pragma GCCPLUGIN sayhello%> from function %qE: %s", 39 "%<pragma GCCPLUGIN sayhello%> from function %qE: %s",
39 cfun->decl, TREE_STRING_POINTER (message)); 40 cfun->decl, TREE_STRING_POINTER (message));
40 else 41 else
41 warning (OPT_Wpragmas, 42 warning_at (loc, OPT_Wpragmas,
42 "%<pragma GCCPLUGIN sayhello%> outside of function: %s", 43 "%<pragma GCCPLUGIN sayhello%> outside of function: %s",
43 TREE_STRING_POINTER (message)); 44 TREE_STRING_POINTER (message));
44 } 45 }
45 } 46 }
46 47
47 /* Plugin callback called during pragma registration */ 48 /* Plugin callback called during pragma registration */
48 49