Initial commit from sysy-main
This commit is contained in:
20
test/20_test_licm_sr.sy
Normal file
20
test/20_test_licm_sr.sy
Normal file
@@ -0,0 +1,20 @@
|
||||
//test file for loop-invariant code motion (licm) and strength reduction (sr is optional)
|
||||
|
||||
int main(){
|
||||
const int a = 1;
|
||||
const int b = 2;
|
||||
int c, d, f;
|
||||
|
||||
int i = 0;
|
||||
while(i < 100){
|
||||
c = a + b;
|
||||
d = c * 2;
|
||||
|
||||
if(i > 50){
|
||||
f = i * d;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
return f;
|
||||
}
|
||||
Reference in New Issue
Block a user