73 lines · plain
1; RUN: llvm-reduce --abort-on-invalid-reduction --delta-passes=target-features-attr --test FileCheck --test-arg -enable-var-scope --test-arg --check-prefixes=INTERESTING,CHECK --test-arg %s --test-arg --input-file %s -o %t2; RUN: FileCheck -check-prefixes=RESULT,CHECK %s < %t3 4; CHECK: @keep_none_from_one() [[$KEEP_NONE_FROM_ONE:#[0-9]+]]5define void @keep_none_from_one() #0 {6 ret void7}8 9; CHECK: @keep_one_from_one() [[$KEEP_ONE_FROM_ONE:#[0-9]+]]10define void @keep_one_from_one() #1 {11 ret void12}13 14; CHECK: @keep_first_from_two() [[$KEEP_FIRST_FROM_TWO:#[0-9]+]]15define void @keep_first_from_two() #2 {16 ret void17}18 19; CHECK: @keep_second_from_two() [[$KEEP_SECOND_FROM_TWO:#[0-9]+]]20define void @keep_second_from_two() #3 {21 ret void22}23 24; CHECK: @keep_all_of_two() [[$KEEP_ALL_OF_TWO:#[0-9]+]]25define void @keep_all_of_two() #4 {26 ret void27}28 29; CHECK: @drop_empty_element() [[$DROP_EMPTY_ELEMENT:#[0-9]+]]30define void @drop_empty_element() #5 {31 ret void32}33 34; CHECK: @keep_second_from_three() [[$KEEP_SECOND_FROM_THREE:#[0-9]+]]35define void @keep_second_from_three() #6 {36 ret void37}38 39; RESULT: define void @no_target_features() {40define void @no_target_features() {41 ret void42}43 44; IR verifier should probably reject this45; RESULT: define void @no_target_features_value() {46define void @no_target_features_value() #7 {47 ret void48}49 50attributes #0 = { "target-features"="+foo" "unique-attr-0" }51attributes #1 = { "target-features"="+foo" "unique-attr-1" }52attributes #2 = { "target-features"="+first,+second" "unique-attr-2" }53attributes #3 = { "target-features"="+first,+second" "unique-attr-3" }54attributes #4 = { "target-features"="+first,+second" "unique-attr-4" }55attributes #5 = { "target-features"="+dead,,+beef" "unique-attr-5" }56attributes #6 = { "target-features"="+a,+b,+c" "unique-attr-6" }57attributes #7 = { "target-features" }58 59; INTERESTING-DAG: [[$KEEP_ONE_FROM_ONE]] = { "target-features"="+foo"60; INTERESTING-DAG: [[$KEEP_FIRST_FROM_TWO]] = { "target-features"="{{.*}}+first61; INTERESTING-DAG: [[$KEEP_SECOND_FROM_TWO]] = { "target-features"="{{.*}}+second62; INTERESTING-DAG: [[$KEEP_ALL_OF_TWO]] = { "target-features"="{{.*}}+first,+second63; INTERESTING-DAG: [[$DROP_EMPTY_ELEMENT]] = { "target-features"="{{.*}}+dead{{.*}}+beef64; INTERESTING-DAG: [[$KEEP_SECOND_FROM_THREE]] = { "target-features"="{{.*}}+b65 66 67; RESULT-DAG: attributes [[$KEEP_NONE_FROM_ONE]] = { "unique-attr-0" }68; RESULT-DAG: [[$KEEP_FIRST_FROM_TWO]] = { "target-features"="+first" "unique-attr-2" }69; RESULT-DAG: [[$KEEP_SECOND_FROM_TWO]] = { "target-features"="+second" "unique-attr-3" }70; RESULT-DAG: [[$KEEP_ALL_OF_TWO]] = { "target-features"="+first,+second" "unique-attr-4" }71; RESULT-DAG: [[$DROP_EMPTY_ELEMENT]] = { "target-features"="+dead,+beef" "unique-attr-5" }72; RESULT-DAG: [[$KEEP_SECOND_FROM_THREE]] = { "target-features"="+b" "unique-attr-6" }73