diff --git a/gcc/hello b/gcc/hello new file mode 100755 index 0000000000000..3052f8f278f68 Binary files /dev/null and b/gcc/hello differ diff --git a/gcc/hello.c b/gcc/hello.c new file mode 100644 index 0000000000000..6a8c259659c9f --- /dev/null +++ b/gcc/hello.c @@ -0,0 +1,7 @@ +#include + +__attribute__((target_clones("default","sve2","sve"))) +int main() { + printf("Hello, World!\n"); +} + diff --git a/gcc/multiple_target.cc b/gcc/multiple_target.cc index c9aba20af877f..ab76af24ac45e 100644 --- a/gcc/multiple_target.cc +++ b/gcc/multiple_target.cc @@ -387,9 +387,9 @@ expand_target_clones (struct cgraph_node *node, bool definition) DECL_FUNCTION_VERSIONED (node->decl) = 1; const int no_of_attr=2;//declaring the number of hardcoded target archietecture we want to pass - char attr_array[no_of_attr][5]={"sve-bf16","sve2"};// hard coded targets + char attr_array[no_of_attr][5]={"sve","sve2"};// hard coded targets - for (i = 0; i < attrnum; i++) + for (i = 0; i < no_of_attr; i++) { char *attr = attr_array[i];//changing the array name @@ -397,6 +397,7 @@ expand_target_clones (struct cgraph_node *node, bool definition) tree attributes = make_attribute (new_attr_name, attr, DECL_ATTRIBUTES (node->decl)); + char *suffix = XNEWVEC (char, strlen (attr) + 1); create_new_asm_name (attr, suffix); cgraph_node *new_node = create_target_clone (node, definition, suffix, diff --git a/hello.c b/hello.c new file mode 100644 index 0000000000000..3dd4dce7100e8 --- /dev/null +++ b/hello.c @@ -0,0 +1,8 @@ +#include + +__attribute__((target_clones("default","sve2"))) +int main() { + // Print "Hello, World!" to the console + printf("Hello, World!\n"); +} +