|
7 | 7 | my $run_all_lf = "$optset_work_dir/run_all.lf";
|
8 | 8 |
|
9 | 9 | my $is_dynamic_suite = 0;
|
| 10 | +my $prebuilt_buildstamp = ""; |
10 | 11 |
|
11 | 12 | # @test_to_run_list stores only the test(s) that will be run
|
12 | 13 | # For example, for "tc -t llvm_test_suite_sycl/aot_cpu,aot_gpu" it will store 2 tests - aot_cpu and aot_gpu
|
@@ -92,9 +93,48 @@ sub is_suite {
|
92 | 93 | return is_same(\@current_test_list, \@whole_suite_test);
|
93 | 94 | }
|
94 | 95 |
|
| 96 | +sub compatibility_win { |
| 97 | + # The backward compatibility testing requires applications that were built by old released compiler |
| 98 | + # can be run on new runtime, it is difficult to set the correct environment by ics infra because |
| 99 | + # both compiler executables *.exe and compiler libraries *.dll are in the %PATH% environment. |
| 100 | + # So, we put pre-built tests on rdrive and use the backward compatibility testing on Windows |
| 101 | + my $compiler_path = ""; |
| 102 | + if (not defined $ENV{BASECOMPILER}) { |
| 103 | + $failure_message = "fail to get path of base compiler, requiers option: \"base=1\""; |
| 104 | + return $COMPFAIL; |
| 105 | + } else { |
| 106 | + $compiler_path = $ENV{BASECOMPILER}; |
| 107 | + } |
| 108 | + |
| 109 | + if ($compiler_path =~ /deploy_(xmain-rel)\/xmainefi2[a-z]{1,}\/([0-9]{8})_([0-9]{6})/) { |
| 110 | + $prebuilt_buildstamp = "$2\_$3"; |
| 111 | + } else { |
| 112 | + $failure_message = "fail to get buildstamp of base compiler"; |
| 113 | + return $COMPFAIL; |
| 114 | + } |
| 115 | + |
| 116 | + if (not ($current_optset eq "opt_use_cpu" or $current_optset eq "opt_use_gpu")) { |
| 117 | + $failure_message = "backward compatibility testing only supports 1) opt_use_cpu and 2) opt_use_gpu"; |
| 118 | + return $COMPFAIL; |
| 119 | + } |
| 120 | + |
| 121 | + # Always use mainline testbase for both xmain and xmain-rel. |
| 122 | + my $prebuilt = "$ENV{ICS_TESTDATA}/mainline/CT-SpecialTests/llvm_test_suite/$prebuilt_buildstamp/win/$current_optset/prebuilt.tar.gz"; |
| 123 | + execute("tar -xzf $prebuilt"); |
| 124 | + if ($command_status != 0) { |
| 125 | + $failure_message = "fail to extract $prebuilt"; |
| 126 | + return $COMPFAIL; |
| 127 | + } |
| 128 | + |
| 129 | + # Get test list |
| 130 | + @test_to_run_list = get_dynamic_test_list(); |
| 131 | + return $PASS; |
| 132 | +} |
| 133 | + |
95 | 134 | sub init_test
|
96 | 135 | {
|
97 | 136 | if ($current_suite =~ /compatibility_llvm_test_suite_sycl/) {
|
| 137 | + return compatibility_win() if (is_windows()); |
98 | 138 | my @folder_list = ("SYCL", $config_folder);
|
99 | 139 | my $folder_not_exist = 0;
|
100 | 140 | my $sparse_file_in_git = ".git/info/sparse-checkout";
|
@@ -556,9 +596,14 @@ sub do_run
|
556 | 596 | $gpu_opts .= "-Dgpu-intel-dg1=1";
|
557 | 597 | }
|
558 | 598 |
|
| 599 | + my $backward_compatibility_opts = ""; |
| 600 | + if (is_windows()) { |
| 601 | + $backward_compatibility_opts = "-Dcompatibility_testing=1"; |
| 602 | + } |
| 603 | + |
559 | 604 | set_tool_path();
|
560 | 605 | if ($is_dynamic_suite == 1 or is_suite()) {
|
561 |
| - execute("$python $lit -a $gpu_opts $matrix $zedebug $jobset . $timeset > $run_all_lf 2>&1"); |
| 606 | + execute("$python $lit -a $backward_compatibility_opts $gpu_opts $matrix $zedebug $jobset . $timeset > $run_all_lf 2>&1"); |
562 | 607 | } else {
|
563 | 608 | execute("$python $lit -a $gpu_opts $matrix $zedebug $path $timeset");
|
564 | 609 | }
|
|
0 commit comments